Documentation ¶
Overview ¶
Package ec2credentials provides information and interaction with the EC2 credentials API resource for the OpenStack Identity service.
For more information, see: https://docs.openstack.org/api-ref/identity/v2-ext/
Example to Create an EC2 credential
createOpts := ec2credentials.CreateOpts{ // project ID of the EC2 credential scope TenantID: projectID, } credential, err := ec2credentials.Create(context.TODO(), identityClient, userID, createOpts).Extract() if err != nil { panic(err) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, userID string) pagination.Pager
List enumerates the Credentials to which the current token has access.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // TenantID is the project ID scope of the EC2 credential. TenantID string `json:"tenant_id" required:"true"` }
CreateOpts provides options used to create an EC2 credential.
func (CreateOpts) ToCredentialCreateMap ¶
func (opts CreateOpts) ToCredentialCreateMap() (map[string]any, error)
ToCredentialCreateMap formats a CreateOpts into a 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 an Credential.
func Create ¶
func Create(ctx context.Context, client *gophercloud.ServiceClient, userID string, opts CreateOpts) (r CreateResult)
Create creates a new EC2 Credential.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*Credential, error)
Extract interprets any Credential results as a Credential.
type Credential ¶
type Credential struct { // UserID contains a User ID of the EC2 credential owner. UserID string `json:"user_id"` // TenantID contains an EC2 credential project scope. TenantID string `json:"tenant_id"` // Access contains an EC2 credential access UUID. Access string `json:"access"` // Secret contains an EC2 credential secret UUID. Secret string `json:"secret"` // TrustID contains an EC2 credential trust ID scope. TrustID string `json:"trust_id"` // Links contains referencing links to the application credential. Links map[string]any `json:"links"` }
Credential represents the application credential object
func ExtractCredentials ¶
func ExtractCredentials(r pagination.Page) ([]Credential, error)
Extractan Credentials returns a slice of Credentials contained in a single page of results.
type CredentialPage ¶
type CredentialPage struct {
pagination.LinkedPageBase
}
an CredentialPage is a single page of an Credential results.
func (CredentialPage) IsEmpty ¶
func (r CredentialPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a an CredentialPage contains any results.
func (CredentialPage) NextPageURL ¶
func (r CredentialPage) NextPageURL() (string, error)
NextPageURL extracts the "next" link from the links section of the result.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.
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 an Credential.
func Get ¶
func Get(ctx context.Context, client *gophercloud.ServiceClient, userID string, id string) (r GetResult)
Get retrieves details on a single EC2 credential by ID.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*Credential, error)
Extract interprets any Credential results as a Credential.