Documentation ¶
Overview ¶
Package certificates contains functionality for working with Magnum Certificate resources.
Package certificates provides information and interaction with the certificates through the OpenStack Container Infra service.
Example to get certificates
certificate, err := certificates.Get(context.TODO(), serviceClient, "d564b18a-2890-4152-be3d-e05d784ff72").Extract() if err != nil { panic(err) }
Example to create certificates
createOpts := certificates.CreateOpts{ BayUUID: "d564b18a-2890-4152-be3d-e05d784ff727", CSR: "-----BEGIN CERTIFICATE REQUEST-----\nMIIEfzCCAmcCAQAwFDESMBAGA1UEAxMJWW91ciBOYW1lMIICIjANBgkqhkiG9w0B\n-----END CERTIFICATE REQUEST-----\n", } response, err := certificates.Create(context.TODO(), client, createOpts).Extract() if err != nil { panic(err) }
Example to update certificates
err := certificates.Update(context.TODO(), client, clusterUUID).ExtractErr() if err != nil { panic(err) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { ClusterUUID string `json:"cluster_uuid"` BayUUID string `json:"bay_uuid"` Links []gophercloud.Link `json:"links"` PEM string `json:"pem"` CSR string `json:"csr"` }
Represents a Certificate
type CreateOpts ¶
type CreateOpts struct { ClusterUUID string `json:"cluster_uuid,omitempty" xor:"BayUUID"` BayUUID string `json:"bay_uuid,omitempty" xor:"ClusterUUID"` CSR string `json:"csr" required:"true"` }
CreateOpts represents options used to create a certificate.
func (CreateOpts) ToCertificateCreateMap ¶
func (opts CreateOpts) ToCertificateCreateMap() (map[string]interface{}, error)
ToCertificateCreateMap constructs a request body from CreateOpts.
type CreateOptsBuilder ¶
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 of a Create operations.
func Create ¶
func Create(ctx context.Context, client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create requests the creation of a new certificate.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a certificate resource.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response of a Get operations.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a certificate resource.
type UpdateResult ¶
type UpdateResult struct {
gophercloud.ErrResult
}
UpdateResult is the response of an Update operations.