Merge pull request #131 from yunify/support-project
Support project feature
This commit is contained in:
commit
ac222d4999
|
@ -841,6 +841,7 @@ type DescribeCachesInput struct {
|
||||||
Caches []*string `json:"caches" name:"caches" location:"params"`
|
Caches []*string `json:"caches" name:"caches" location:"params"`
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
|
|
@ -368,6 +368,7 @@ type DescribeEIPsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
|
|
@ -233,6 +233,7 @@ type DescribeImagesInput struct {
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
// ProcessorType's available values: 64bit, 32bit
|
// ProcessorType's available values: 64bit, 32bit
|
||||||
ProcessorType *string `json:"processor_type" name:"processor_type" location:"params"`
|
ProcessorType *string `json:"processor_type" name:"processor_type" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
// Provider's available values: system, self
|
// Provider's available values: system, self
|
||||||
Provider *string `json:"provider" name:"provider" location:"params"`
|
Provider *string `json:"provider" name:"provider" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
|
|
|
@ -175,6 +175,7 @@ type DescribeInstancesInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
|
|
@ -277,6 +277,7 @@ type DescribeKeyPairsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
|
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
|
||||||
|
|
|
@ -354,6 +354,7 @@ type CreateLoadBalancerInput struct {
|
||||||
LoadBalancerType *int `json:"loadbalancer_type" name:"loadbalancer_type" default:"0" location:"params"`
|
LoadBalancerType *int `json:"loadbalancer_type" name:"loadbalancer_type" default:"0" location:"params"`
|
||||||
NodeCount *int `json:"node_count" name:"node_count" location:"params"`
|
NodeCount *int `json:"node_count" name:"node_count" location:"params"`
|
||||||
PrivateIP *string `json:"private_ip" name:"private_ip" location:"params"`
|
PrivateIP *string `json:"private_ip" name:"private_ip" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"`
|
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"`
|
||||||
VxNet *string `json:"vxnet" name:"vxnet" location:"params"`
|
VxNet *string `json:"vxnet" name:"vxnet" location:"params"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,6 +486,7 @@ type DescribeMongosInput struct {
|
||||||
MongoName *string `json:"mongo_name" name:"mongo_name" location:"params"`
|
MongoName *string `json:"mongo_name" name:"mongo_name" location:"params"`
|
||||||
Mongos []*string `json:"mongos" name:"mongos" location:"params"`
|
Mongos []*string `json:"mongos" name:"mongos" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
||||||
|
|
|
@ -237,6 +237,7 @@ type DescribeNicsInput struct {
|
||||||
Nics []*string `json:"nics" name:"nics" location:"params"`
|
Nics []*string `json:"nics" name:"nics" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
// Status's available values: available, in-use
|
// Status's available values: available, in-use
|
||||||
Status *string `json:"status" name:"status" location:"params"`
|
Status *string `json:"status" name:"status" location:"params"`
|
||||||
VxNetType []*int `json:"vxnet_type" name:"vxnet_type" location:"params"`
|
VxNetType []*int `json:"vxnet_type" name:"vxnet_type" location:"params"`
|
||||||
|
|
|
@ -0,0 +1,262 @@
|
||||||
|
// +-------------------------------------------------------------------------
|
||||||
|
// | Copyright (C) 2016 Yunify, Inc.
|
||||||
|
// +-------------------------------------------------------------------------
|
||||||
|
// | Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// | you may not use this work except in compliance with the License.
|
||||||
|
// | You may obtain a copy of the License in the LICENSE file, or at:
|
||||||
|
// |
|
||||||
|
// | http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
// |
|
||||||
|
// | Unless required by applicable law or agreed to in writing, software
|
||||||
|
// | distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// | See the License for the specific language governing permissions and
|
||||||
|
// | limitations under the License.
|
||||||
|
// +-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/config"
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/request"
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/request/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ fmt.State
|
||||||
|
var _ time.Time
|
||||||
|
|
||||||
|
type ProjectService struct {
|
||||||
|
Config *config.Config
|
||||||
|
Properties *ProjectServiceProperties
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProjectServiceProperties struct {
|
||||||
|
// QingCloud Zone ID
|
||||||
|
Zone *string `json:"zone" name:"zone"` // Required
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *QingCloudService) Project(zone string) (*ProjectService, error) {
|
||||||
|
properties := &ProjectServiceProperties{
|
||||||
|
Zone: &zone,
|
||||||
|
}
|
||||||
|
|
||||||
|
return &ProjectService{Config: s.Config, Properties: properties}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ProjectService) AddProjectResourceItems(i *AddProjectResourceItemsInput) (*AddProjectResourceItemsOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &AddProjectResourceItemsInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "AddProjectResourceItems",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &AddProjectResourceItemsOutput{}
|
||||||
|
r, err := request.New(o, i, x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.Send()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return x, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type AddProjectResourceItemsInput struct {
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"` // Required
|
||||||
|
Resources []*string `json:"resources" name:"resources" location:"params"` // Required
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *AddProjectResourceItemsInput) Validate() error {
|
||||||
|
|
||||||
|
if v.ProjectID == nil {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "ProjectID",
|
||||||
|
ParentName: "AddProjectResourceItemsInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(v.Resources) == 0 {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "Resources",
|
||||||
|
ParentName: "AddProjectResourceItemsInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type AddProjectResourceItemsOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
Action *string `json:"action" name:"action" location:"elements"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"elements"`
|
||||||
|
ResourceIDs []*string `json:"resource_ids" name:"resource_ids" location:"elements"`
|
||||||
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
|
ZoneID *string `json:"zone_id" name:"zone_id" location:"elements"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ProjectService) DeleteProjectResourceItems(i *DeleteProjectResourceItemsInput) (*DeleteProjectResourceItemsOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &DeleteProjectResourceItemsInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "DeleteProjectResourceItems",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &DeleteProjectResourceItemsOutput{}
|
||||||
|
r, err := request.New(o, i, x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.Send()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return x, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteProjectResourceItemsInput struct {
|
||||||
|
ProjectID []*string `json:"project_id" name:"project_id" location:"params"` // Required
|
||||||
|
Resources []*string `json:"resources" name:"resources" location:"params"` // Required
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *DeleteProjectResourceItemsInput) Validate() error {
|
||||||
|
|
||||||
|
if len(v.ProjectID) == 0 {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "ProjectID",
|
||||||
|
ParentName: "DeleteProjectResourceItemsInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(v.Resources) == 0 {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "Resources",
|
||||||
|
ParentName: "DeleteProjectResourceItemsInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteProjectResourceItemsOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
Action *string `json:"action" name:"action" location:"elements"`
|
||||||
|
ProjectID []*string `json:"project_id" name:"project_id" location:"elements"`
|
||||||
|
ResourceIDs []*string `json:"resource_ids" name:"resource_ids" location:"elements"`
|
||||||
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
|
ZoneID *string `json:"zone_id" name:"zone_id" location:"elements"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ProjectService) DescribeProjectResourceItems(i *DescribeProjectResourceItemsInput) (*DescribeProjectResourceItemsOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &DescribeProjectResourceItemsInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "DescribeProjectResourceItems",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &DescribeProjectResourceItemsOutput{}
|
||||||
|
r, err := request.New(o, i, x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.Send()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return x, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeProjectResourceItemsInput struct {
|
||||||
|
InGlobal *int `json:"in_global" name:"in_global" location:"params"`
|
||||||
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectIDs []*string `json:"project_ids" name:"project_ids" location:"params"`
|
||||||
|
Reserve *int `json:"reserve" name:"reserve" location:"params"`
|
||||||
|
ResourceTypes []*string `json:"resource_types" name:"resource_types" location:"params"`
|
||||||
|
Resources []*string `json:"resources" name:"resources" location:"params"`
|
||||||
|
SortKey *string `json:"sort_key" name:"sort_key" location:"params"`
|
||||||
|
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *DescribeProjectResourceItemsInput) Validate() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeProjectResourceItemsOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
Action *string `json:"action" name:"action" location:"elements"`
|
||||||
|
ProjectResourceItemSet []*ProjectResourceItem `json:"project_resource_item_set" name:"project_resource_item_set" location:"elements"`
|
||||||
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ProjectService) DescribeProjects(i *DescribeProjectsInput) (*DescribeProjectsOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &DescribeProjectsInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "DescribeProjects",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &DescribeProjectsOutput{}
|
||||||
|
r, err := request.New(o, i, x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.Send()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return x, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeProjectsInput struct {
|
||||||
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectIDs []*string `json:"project_ids" name:"project_ids" location:"params"`
|
||||||
|
Shared *string `json:"shared" name:"shared" default:"False" location:"params"`
|
||||||
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *DescribeProjectsInput) Validate() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeProjectsOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
Action *string `json:"action" name:"action" location:"elements"`
|
||||||
|
ProjectSet []*Project `json:"project_set" name:"project_set" location:"elements"`
|
||||||
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
||||||
|
}
|
|
@ -710,6 +710,7 @@ func (s *RDBService) DescribeRDBs(i *DescribeRDBsInput) (*DescribeRDBsOutput, er
|
||||||
type DescribeRDBsInput struct {
|
type DescribeRDBsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" location:"params"`
|
Limit *int `json:"limit" name:"limit" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" location:"params"`
|
Offset *int `json:"offset" name:"offset" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
RDBEngine *string `json:"rdb_engine" name:"rdb_engine" location:"params"`
|
RDBEngine *string `json:"rdb_engine" name:"rdb_engine" location:"params"`
|
||||||
RDBName *string `json:"rdb_name" name:"rdb_name" location:"params"`
|
RDBName *string `json:"rdb_name" name:"rdb_name" location:"params"`
|
||||||
RDBs []*string `json:"rdbs" name:"rdbs" location:"params"`
|
RDBs []*string `json:"rdbs" name:"rdbs" location:"params"`
|
||||||
|
|
|
@ -638,6 +638,7 @@ type DescribeRoutersInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" location:"params"`
|
Limit *int `json:"limit" name:"limit" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" location:"params"`
|
Offset *int `json:"offset" name:"offset" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
Routers []*string `json:"routers" name:"routers" location:"params"`
|
Routers []*string `json:"routers" name:"routers" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
|
|
|
@ -162,6 +162,55 @@ type ApplySecurityGroupOutput struct {
|
||||||
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Documentation URL: https://docs.qingcloud.com/api/sg/apply_security_group_ipsets.html
|
||||||
|
func (s *SecurityGroupService) ApplySecurityGroupIPSets(i *ApplySecurityGroupIPSetsInput) (*ApplySecurityGroupIPSetsOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &ApplySecurityGroupIPSetsInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "ApplySecurityGroupIPSets",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &ApplySecurityGroupIPSetsOutput{}
|
||||||
|
r, err := request.New(o, i, x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.Send()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return x, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type ApplySecurityGroupIPSetsInput struct {
|
||||||
|
SecurityGroupIPSets []*string `json:"security_group_ipsets" name:"security_group_ipsets" location:"params"` // Required
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *ApplySecurityGroupIPSetsInput) Validate() error {
|
||||||
|
|
||||||
|
if len(v.SecurityGroupIPSets) == 0 {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "SecurityGroupIPSets",
|
||||||
|
ParentName: "ApplySecurityGroupIPSetsInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ApplySecurityGroupIPSetsOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
Action *string `json:"action" name:"action" location:"elements"`
|
||||||
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
||||||
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
||||||
|
}
|
||||||
|
|
||||||
// Documentation URL: https://docs.qingcloud.com/api/sg/create_security_group.html
|
// Documentation URL: https://docs.qingcloud.com/api/sg/create_security_group.html
|
||||||
func (s *SecurityGroupService) CreateSecurityGroup(i *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) {
|
func (s *SecurityGroupService) CreateSecurityGroup(i *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) {
|
||||||
if i == nil {
|
if i == nil {
|
||||||
|
@ -564,6 +613,7 @@ type DescribeSecurityGroupIPSetsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SecurityGroupIPSetName *string `json:"security_group_ipset_name" name:"security_group_ipset_name" location:"params"`
|
SecurityGroupIPSetName *string `json:"security_group_ipset_name" name:"security_group_ipset_name" location:"params"`
|
||||||
SecurityGroupIPSets []*string `json:"security_group_ipsets" name:"security_group_ipsets" location:"params"`
|
SecurityGroupIPSets []*string `json:"security_group_ipsets" name:"security_group_ipsets" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
@ -702,6 +752,7 @@ func (s *SecurityGroupService) DescribeSecurityGroupSnapshots(i *DescribeSecurit
|
||||||
type DescribeSecurityGroupSnapshotsInput struct {
|
type DescribeSecurityGroupSnapshotsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
Reverse *int `json:"reverse" name:"reverse" default:"1" location:"params"`
|
Reverse *int `json:"reverse" name:"reverse" default:"1" location:"params"`
|
||||||
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"` // Required
|
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"` // Required
|
||||||
SecurityGroupSnapshots []*string `json:"security_group_snapshots" name:"security_group_snapshots" location:"params"`
|
SecurityGroupSnapshots []*string `json:"security_group_snapshots" name:"security_group_snapshots" location:"params"`
|
||||||
|
@ -757,6 +808,7 @@ type DescribeSecurityGroupsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
SecurityGroups []*string `json:"security_groups" name:"security_groups" location:"params"`
|
SecurityGroups []*string `json:"security_groups" name:"security_groups" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
|
|
@ -352,6 +352,7 @@ type DescribeSnapshotsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
ResourceID *string `json:"resource_id" name:"resource_id" location:"params"`
|
ResourceID *string `json:"resource_id" name:"resource_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
SnapshotTime *string `json:"snapshot_time" name:"snapshot_time" location:"params"`
|
SnapshotTime *string `json:"snapshot_time" name:"snapshot_time" location:"params"`
|
||||||
|
|
|
@ -1848,6 +1848,44 @@ func (v *NICVxNet) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Project struct {
|
||||||
|
ConsoleID *string `json:"console_id" name:"console_id"`
|
||||||
|
CreateTime *string `json:"create_time" name:"create_time"`
|
||||||
|
Description *string `json:"description" name:"description"`
|
||||||
|
Enabled *int `json:"enabled" name:"enabled"`
|
||||||
|
Meta *string `json:"meta" name:"meta"`
|
||||||
|
Owner *string `json:"owner" name:"owner"`
|
||||||
|
OwnerName *string `json:"owner_name" name:"owner_name"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id"`
|
||||||
|
ProjectName *string `json:"project_name" name:"project_name"`
|
||||||
|
ResourceGroupID *string `json:"resource_group_id" name:"resource_group_id"`
|
||||||
|
RootUserID *string `json:"root_user_id" name:"root_user_id"`
|
||||||
|
Status *string `json:"status" name:"status"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Project) Validate() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProjectResourceItem struct {
|
||||||
|
CreateTime *string `json:"create_time" name:"create_time"`
|
||||||
|
Meta *string `json:"meta" name:"meta"`
|
||||||
|
Owner *string `json:"owner" name:"owner"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id"`
|
||||||
|
ProjectName *string `json:"project_name" name:"project_name"`
|
||||||
|
ResourceGroupID *string `json:"resource_group_id" name:"resource_group_id"`
|
||||||
|
ResourceID *string `json:"resource_id" name:"resource_id"`
|
||||||
|
ResourceType *string `json:"resource_type" name:"resource_type"`
|
||||||
|
RootUserID *string `json:"root_user_id" name:"root_user_id"`
|
||||||
|
ZoneID *string `json:"zone_id" name:"zone_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *ProjectResourceItem) Validate() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type QuotaLeft struct {
|
type QuotaLeft struct {
|
||||||
Left *int `json:"left" name:"left"`
|
Left *int `json:"left" name:"left"`
|
||||||
ResourceType *string `json:"resource_type" name:"resource_type"`
|
ResourceType *string `json:"resource_type" name:"resource_type"`
|
||||||
|
|
|
@ -334,6 +334,7 @@ type DescribeVolumesInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Status []*string `json:"status" name:"status" location:"params"`
|
Status []*string `json:"status" name:"status" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
|
|
|
@ -254,6 +254,7 @@ type DescribeVxNetsInput struct {
|
||||||
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
||||||
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
||||||
Tags []*string `json:"tags" name:"tags" location:"params"`
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
||||||
// Verbose's available values: 0, 1
|
// Verbose's available values: 0, 1
|
||||||
|
|
Loading…
Reference in New Issue