Merge pull request #126 from yunify/add-delete-access-keys
add-delete-access-keys & fix describe-clusters
This commit is contained in:
commit
d4f377108a
|
@ -23,7 +23,7 @@ import (
|
||||||
"github.com/yunify/qingcloud-sdk-go/config"
|
"github.com/yunify/qingcloud-sdk-go/config"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request"
|
"github.com/yunify/qingcloud-sdk-go/request"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request/data"
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
||||||
//"github.com/yunify/qingcloud-sdk-go/request/errors"
|
"github.com/yunify/qingcloud-sdk-go/request/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ fmt.State
|
var _ fmt.State
|
||||||
|
@ -47,6 +47,55 @@ func (s *QingCloudService) Accesskey(zone string) (*AccesskeyService, error) {
|
||||||
return &AccesskeyService{Config: s.Config, Properties: properties}, nil
|
return &AccesskeyService{Config: s.Config, Properties: properties}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *AccesskeyService) DeleteAccessKeys(i *DeleteAccessKeysInput) (*DeleteAccessKeysOutput, error) {
|
||||||
|
if i == nil {
|
||||||
|
i = &DeleteAccessKeysInput{}
|
||||||
|
}
|
||||||
|
o := &data.Operation{
|
||||||
|
Config: s.Config,
|
||||||
|
Properties: s.Properties,
|
||||||
|
APIName: "DeleteAccessKeys",
|
||||||
|
RequestMethod: "GET",
|
||||||
|
}
|
||||||
|
|
||||||
|
x := &DeleteAccessKeysOutput{}
|
||||||
|
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 DeleteAccessKeysInput struct {
|
||||||
|
AccessKeys []*string `json:"access_keys" name:"access_keys" location:"params"` // Required
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *DeleteAccessKeysInput) Validate() error {
|
||||||
|
|
||||||
|
if len(v.AccessKeys) == 0 {
|
||||||
|
return errors.ParameterRequiredError{
|
||||||
|
ParameterName: "AccessKeys",
|
||||||
|
ParentName: "DeleteAccessKeysInput",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteAccessKeysOutput struct {
|
||||||
|
Message *string `json:"message" name:"message"`
|
||||||
|
AccessKeys []*string `json:"access_keys" name:"access_keys" location:"elements"`
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
func (s *AccesskeyService) DescribeAccessKeys(i *DescribeAccessKeysInput) (*DescribeAccessKeysOutput, error) {
|
func (s *AccesskeyService) DescribeAccessKeys(i *DescribeAccessKeysInput) (*DescribeAccessKeysOutput, error) {
|
||||||
if i == nil {
|
if i == nil {
|
||||||
i = &DescribeAccessKeysInput{}
|
i = &DescribeAccessKeysInput{}
|
||||||
|
|
|
@ -508,14 +508,14 @@ type Cluster struct {
|
||||||
IncrementalBackupSupported *bool `json:"incremental_backup_supported" name:"incremental_backup_supported"`
|
IncrementalBackupSupported *bool `json:"incremental_backup_supported" name:"incremental_backup_supported"`
|
||||||
LatestSnapshotTime *string `json:"latest_snapshot_time" name:"latest_snapshot_time"`
|
LatestSnapshotTime *string `json:"latest_snapshot_time" name:"latest_snapshot_time"`
|
||||||
Links map[string]*string `json:"links" name:"links"`
|
Links map[string]*string `json:"links" name:"links"`
|
||||||
MetadataRootAccess *int `json:"metadata_root_access" name:"metadata_root_access"`
|
MetadataRootAccess *bool `json:"metadata_root_access" name:"metadata_root_access"`
|
||||||
Name *string `json:"name" name:"name"`
|
Name *string `json:"name" name:"name"`
|
||||||
NodeCount *int `json:"node_count" name:"node_count"`
|
NodeCount *int `json:"node_count" name:"node_count"`
|
||||||
Nodes []*ClusterNode `json:"nodes" name:"nodes"`
|
Nodes []*ClusterNode `json:"nodes" name:"nodes"`
|
||||||
Owner *string `json:"owner" name:"owner"`
|
Owner *string `json:"owner" name:"owner"`
|
||||||
PartnerAccess *bool `json:"partner_access" name:"partner_access"`
|
PartnerAccess *bool `json:"partner_access" name:"partner_access"`
|
||||||
RestoreService interface{} `json:"restore_service" name:"restore_service"`
|
RestoreService interface{} `json:"restore_service" name:"restore_service"`
|
||||||
ReuseHyper *int `json:"reuse_hyper" name:"reuse_hyper"`
|
ReuseHyper *bool `json:"reuse_hyper" name:"reuse_hyper"`
|
||||||
RoleCount map[string]*int `json:"role_count" name:"role_count"`
|
RoleCount map[string]*int `json:"role_count" name:"role_count"`
|
||||||
Roles []*string `json:"roles" name:"roles"`
|
Roles []*string `json:"roles" name:"roles"`
|
||||||
RootUserID *string `json:"root_user_id" name:"root_user_id"`
|
RootUserID *string `json:"root_user_id" name:"root_user_id"`
|
||||||
|
|
Loading…
Reference in New Issue