certificates

package
v2.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

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

type CreateOptsBuilder interface {
	ToCertificateCreateMap() (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 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 Get

func Get(ctx context.Context, client *gophercloud.ServiceClient, clusterID string) (r GetResult)

Get makes a request against the API to get details for a certificate.

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.

func Update

func Update(ctx context.Context, client *gophercloud.ServiceClient, clusterID string) (r UpdateResult)

Update will rotate the CA certificate for a cluster

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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