certificates

package
v2.41.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteByID added in v2.33.0

func DeleteByID(client newclient.Client, spaceID string, ID string) error

DeleteByID deletes a certificate based on the provided ID.

func Get added in v2.33.0

func Get(client newclient.Client, spaceID string, certificatesQuery CertificatesQuery) (*resources.Resources[*CertificateResource], error)

Get returns a collection of certificates based on the criteria defined by its input query parameter. If an error occurs, a nil is returned along with the associated error.

func IsNil

func IsNil(i interface{}) bool

Types

type CertificateResource

type CertificateResource struct {
	Archived                 string                      `json:"Archived,omitempty"`
	CertificateData          *core.SensitiveValue        `json:"CertificateData,omitempty" validate:"required"`
	CertificateDataFormat    string                      `json:"CertificateDataFormat,omitempty"`
	EnvironmentIDs           []string                    `json:"EnvironmentIds,omitempty"`
	HasPrivateKey            bool                        `json:"HasPrivateKey"`
	IsExpired                bool                        `json:"IsExpired"`
	IssuerCommonName         string                      `json:"IssuerCommonName,omitempty"`
	IssuerDistinguishedName  string                      `json:"IssuerDistinguishedName,omitempty"`
	IssuerOrganization       string                      `json:"IssuerOrganization,omitempty"`
	Name                     string                      `json:"Name,omitempty" validate:"required"`
	NotAfter                 string                      `json:"NotAfter,omitempty"`
	NotBefore                string                      `json:"NotBefore,omitempty"`
	Notes                    string                      `json:"Notes,omitempty"`
	Password                 *core.SensitiveValue        `json:"Password,omitempty"`
	ReplacedBy               string                      `json:"ReplacedBy,omitempty"`
	SelfSigned               bool                        `json:"SelfSigned"`
	SerialNumber             string                      `json:"SerialNumber,omitempty"`
	SignatureAlgorithmName   string                      `json:"SignatureAlgorithmName,omitempty"`
	SpaceID                  string                      `json:"SpaceId,omitempty"`
	SubjectAlternativeNames  []string                    `json:"SubjectAlternativeNames,omitempty"`
	SubjectCommonName        string                      `json:"SubjectCommonName,omitempty"`
	SubjectDistinguishedName string                      `json:"SubjectDistinguishedName,omitempty"`
	SubjectOrganization      string                      `json:"SubjectOrganization,omitempty"`
	TenantedDeploymentMode   core.TenantedDeploymentMode `json:"TenantedDeploymentParticipation"`
	TenantIDs                []string                    `json:"TenantIds,omitempty"`
	TenantTags               []string                    `json:"TenantTags,omitempty"`
	Thumbprint               string                      `json:"Thumbprint,omitempty"`
	Version                  int                         `json:"Version,omitempty"`

	resources.Resource
}

func Add added in v2.33.0

func Add(client newclient.Client, certificate *CertificateResource) (*CertificateResource, error)

Add creates a new certificate.

func GetAll added in v2.34.0

func GetAll(client newclient.Client, spaceID string) ([]*CertificateResource, error)

GetAll returns all certificates. If an error occurs, it returns nil.

func GetByID added in v2.33.0

func GetByID(client newclient.Client, spaceID string, ID string) (*CertificateResource, error)

GetByID returns the certificate that matches the input ID. If one cannot be found, it returns nil and an error.

func NewCertificateResource

func NewCertificateResource(name string, certificateData *core.SensitiveValue, password *core.SensitiveValue) *CertificateResource

NewCertificateResource initializes a certificate resource with a name and credentials.

func Update added in v2.33.0

func Update(client newclient.Client, resource *CertificateResource) (*CertificateResource, error)

Update modifies a Certificate based on the one provided as input.

func (CertificateResource) Validate

func (c CertificateResource) Validate() error

Validate checks the state of the certificate resource and returns an error if invalid.

type CertificateService

type CertificateService struct {
	services.CanDeleteService
}

certificateService handles communication with Certificate-related methods of the Octopus API.

func NewCertificateService

func NewCertificateService(sling *sling.Sling, uriTemplate string) *CertificateService

NewCertificateService returns an certificateService with a preconfigured client.

func (*CertificateService) Add deprecated

Add creates a new certificate.

Deprecated: use certificates.Add

func (*CertificateService) Archive

Archive sets the status of a certificate to an archived state.

func (*CertificateService) Get deprecated

Get returns a collection of certificates based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.

Deprecated: use certificates.Get

func (*CertificateService) GetAll deprecated

func (s *CertificateService) GetAll() ([]*CertificateResource, error)

GetAll returns all certificates. If none are found or an error occurs, it returns an empty collection.

Deprecated: use certificates.GetAll

func (*CertificateService) GetByID deprecated

GetByID returns the certificate that matches the input ID. If one cannot be found, it returns nil and an error.

Deprecated: use certificates.GetByID

func (*CertificateService) Replace

func (s *CertificateService) Replace(certificateID string, replacementCertificate *ReplacementCertificate) (*CertificateResource, error)

func (*CertificateService) Unarchive

Unarchive resets the status of an archived certificate.

func (*CertificateService) Update deprecated

Update modifies a Certificate based on the one provided as input.

Deprecated: use certificates.Update

type CertificatesQuery

type CertificatesQuery struct {
	Archived    string   `uri:"archived,omitempty" url:"archived,omitempty"`
	FirstResult string   `uri:"firstResult,omitempty" url:"firstResult,omitempty"`
	IDs         []string `uri:"ids,omitempty" url:"ids,omitempty"`
	OrderBy     string   `uri:"orderBy,omitempty" url:"orderBy,omitempty"`
	PartialName string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	Search      string   `uri:"search,omitempty" url:"search,omitempty"`
	Skip        int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Take        int      `uri:"take,omitempty" url:"take,omitempty"`
	Tenant      string   `uri:"tenant,omitempty" url:"tenant,omitempty"`
}

type ReplacementCertificate

type ReplacementCertificate struct {
	CertificateData string `json:"CertificateData,omitempty"`
	Password        string `json:"Password,omitempty"`
}

func NewReplacementCertificate

func NewReplacementCertificate(certificateData string, password string) *ReplacementCertificate

Jump to

Keyboard shortcuts

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