policies

package
v0.0.0-...-d823fe1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List retrieves all custom policies.

Types

type CreateOpts

type CreateOpts struct {
	Name        string `json:"display_name" required:"true"`
	Type        string `json:"type" required:"true"`
	Description string `json:"description" required:"true"`
	Policy      Policy `json:"policy" required:"true"`
}

CreateOpts provides options used to create a policy.

func (CreateOpts) ToPolicyCreateMap

func (opts CreateOpts) ToPolicyCreateMap() (map[string]interface{}, error)

ToPolicyCreateMap formats a CreateOpts into a create request.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPolicyCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a Role

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create creates a new Policy.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Role, error)

Extract interprets any roleResults as a Role.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.

func Delete

func Delete(client *golangsdk.ServiceClient, roleID string) (r DeleteResult)

Delete deletes a policy.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Role.

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves details on a single policy, by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Role, error)

Extract interprets any roleResults as a Role.

type Policy

type Policy struct {
	Version   string      `json:"Version" required:"true"`
	Statement []Statement `json:"Statement" required:"true"`
}

Policy contains the content of a custom policy.

type Role

type Role struct {
	ID          string `json:"id"`
	Name        string `json:"display_name"`
	Catalog     string `json:"catalog"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Policy      Policy `json:"policy" required:"true"`
	DomainId    string `json:"domain_id"`
	References  int    `json:"references"`
}

func ExtractPageRoles

func ExtractPageRoles(r pagination.Page) ([]Role, error)

type RolePage

type RolePage struct {
	pagination.LinkedPageBase
}

func (RolePage) IsEmpty

func (r RolePage) IsEmpty() (bool, error)

func (RolePage) NextPageURL

func (r RolePage) NextPageURL() (string, error)

type Statement

type Statement struct {
	Action    []string               `json:"Action" required:"true"`
	Effect    string                 `json:"Effect" required:"true"`
	Condition map[string]interface{} `json:"Condition,omitempty"`
	Resource  interface{}            `json:"Resource,omitempty"`
}

Statement represents the Statement of a custom policy.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a Role.

func Update

func Update(client *golangsdk.ServiceClient, roleID string, opts CreateOptsBuilder) (r UpdateResult)

Update updates an existing Policy.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Role, error)

Extract interprets any roleResults as a Role.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL