Documentation ¶
Index ¶
- Variables
- type Condition
- type CreateOpts
- type CreateOptsBuilder
- type CreatePolicy
- type CreateResult
- type CreateStatement
- type CustomPolicy
- type DeleteResult
- type GetResult
- type Links
- type ListOpts
- type ListPolicy
- type ListResult
- type Policy
- type PolicyPage
- type RolesLinks
- type Statement
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json;charset=utf8"}, }
Functions ¶
This section is empty.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Display name of the custom policy DisplayName string `json:"display_name" required:"true"` // Display mode which can only be AX or XA // AX: Account level. // XA: Project level. Type string `json:"type" required:"true"` // Description of the custom policy Description string `json:"description" required:"true"` // DescriptionCn string `json:"description_cn"` // Content of custom policy. Policy CreatePolicy `json:"policy" required:"true"` }
func (CreateOpts) ToPolicyCreateMap ¶
func (opts CreateOpts) ToPolicyCreateMap() (map[string]interface{}, error)
func (CreateOpts) ToPolicyUpdateMap ¶
func (opts CreateOpts) ToPolicyUpdateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreatePolicy ¶
type CreatePolicy struct { // Policy version. When creating a custom policy, set this parameter to 1.1 Version string `json:"Version" required:"true"` // Statement of the policy // A policy can contain a maximum of eight statements. Statement []CreateStatement `json:"Statement" required:"true"` }
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) ExtractPolicies ¶
func (r CreateResult) ExtractPolicies() (ListPolicy, error)
type CreateStatement ¶
type CreateStatement struct { // Specific operation permission on a resource. A maximum of 100 actions are allowed. // The value format is `Service name:Resource type:Operation`, for example, `vpc:ports:create` // `Service name`: indicates the product name, such as ecs, evs, or vpc. Only lowercase letters are allowed. // Resource types and operations are not case-sensitive. You can use an asterisk (*) to represent all operations. Action []string `json:"Action" required:"true"` // Effect of the permission. The value can be `Allow` or `Deny`. // If both `Allow` and `Deny` statements are found in a policy, // the authentication starts from the `Deny` statements. Effect string `json:"Effect" required:"true"` // Conditions for the permission to take effect. A maximum of 10 conditions are allowed. // Conditions can't be used if `Resource` is selected using delegating agencies. Condition Condition `json:"Condition,omitempty"` // Cloud resource. The array can contain a maximum of 10 resource strings - []string, // and each string cannot exceed 128 characters. // Format: ::::. For example, `obs:::bucket:*`. Asterisks are allowed. // In the case of a custom policy for agencies, the type of this parameter is map[string][]string // and the value should be set to // "Resource": {"uri": ["/iam/agencies/07805acaba800fdd4fbdc00b8f888c7c"]}. Resource interface{} `json:"Resource,omitempty"` }
type CustomPolicy ¶
type DeleteResult ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
func (GetResult) ExtractPolicies ¶
func (r GetResult) ExtractPolicies() (ListPolicy, error)
type ListOpts ¶
type ListOpts struct { DisplayName string Type string ID string Page int `q:"page"` PerPage int `q:"per_page"` }
ListOpts Page&PerPage options currently don't have any effect
func (ListOpts) ToPolicyListQuery ¶
type ListPolicy ¶
type ListPolicy struct { Links Links `json:"links"` Roles []Policy `json:"roles"` TotalNumber int `json:"total_number"` }
func FilterRoles ¶
func FilterRoles(roles ListPolicy, opts ListOpts) (ListPolicy, error)
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpts) (ListPolicy, error)
type ListResult ¶
type ListResult struct {
// contains filtered or unexported fields
}
func (ListResult) ExtractPolicies ¶
func (r ListResult) ExtractPolicies() (ListPolicy, error)
type Policy ¶
type Policy struct { DomainId string `json:"domain_id"` References int `json:"references,omitempty"` UpdatedTime string `json:"updated_time,omitempty"` CreatedTime string `json:"created_time,omitempty"` Catalog string `json:"catalog"` Name string `json:"name"` Description string `json:"description"` Links RolesLinks `json:"links"` ID string `json:"id"` DisplayName string `json:"display_name"` Type string `json:"type"` Policy CustomPolicy `json:"policy"` }
type PolicyPage ¶
type PolicyPage struct {
pagination.LinkedPageBase
}
type RolesLinks ¶
type RolesLinks struct {
Self string `json:"self"`
}
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(c *golangsdk.ServiceClient, id string, opts CreateOpts) (r UpdateResult)
func (UpdateResult) ExtractPolicies ¶
func (r UpdateResult) ExtractPolicies() (ListPolicy, error)
Click to show internal directories.
Click to hide internal directories.