cert

package
v0.9.199 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Overview

cert.go - the certificate APIs definition supported by the Cert service

Package cert defines the Cert services of BCE. The supported APIs are all defined in sub-package

Index

Constants

View Source
const (
	URI_PREFIX                   = bce.URI_PREFIX + "v1"
	DEFAULT_ENDPOINT             = "certificate.baidubce.com"
	REQUEST_CERT_URL             = "/certificate"
	REQUEST_CERT_LIST_DETAIL_URL = "/certificate/detail"
	REQUEST_DETAIL_URL           = "/detail"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertInServiceMeta added in v0.9.183

type CertInServiceMeta struct {
	ServiceName string `json:"serviceName"`
	ResourceID  string `json:"resourceId"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime"`
}

type CertificateDetailMeta added in v0.9.183

type CertificateDetailMeta struct {
	CertId          string              `json:"certId"`
	CertName        string              `json:"certName"`
	CertCommonName  string              `json:"certCommonName"`
	CertFingerprint string              `json:"certFingerprint"`
	CertStartTime   string              `json:"certStartTime"`
	CertStopTime    string              `json:"certStopTime"`
	CertCreateTime  string              `json:"certCreateTime"`
	CertUpdateTime  string              `json:"certUpdateTime"`
	CertType        int                 `json:"certType"`
	CertDNSNames    string              `json:"certDNSNames"`
	Resources       []CertInServiceMeta `json:"resources"`
	Status          string              `json:"status"`
	Expired         bool                `json:"expired"`
}

type CertificateMeta

type CertificateMeta struct {
	CertId          string `json:"certId"`
	CertName        string `json:"certName"`
	CertCommonName  string `json:"certCommonName"`
	CertFingerprint string `json:"certFingerprint"`
	CertStartTime   string `json:"certStartTime"`
	CertStopTime    string `json:"certStopTime"`
	CertCreateTime  string `json:"certCreateTime"`
	CertUpdateTime  string `json:"certUpdateTime"`
	CertType        int    `json:"certType"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of Cert service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) CreateCert

func (c *Client) CreateCert(args *CreateCertArgs) (*CreateCertResult, error)

CreateCert - create a cert with the specific parameters

PARAMS:

  • args: the arguments to create a cert

RETURNS:

  • *CreateCertResult: the result of create Cert, contains new Cert's ID
  • error: nil if success otherwise the specific error

func (*Client) DeleteCert

func (c *Client) DeleteCert(id string) error

DeleteCert - delete a specific cert

PARAMS:

  • id: the specific cert's ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetCertDetail added in v0.9.183

func (c *Client) GetCertDetail(id string) (*CertificateDetailMeta, error)

GetCertDetail - get a specific cert's meta detail

PARAMS:

  • id: the specific cert's ID

RETURNS:

  • *CertificateDetailMeta: the specific cert's meta detail
  • error: nil if success otherwise the specific error

func (*Client) GetCertMeta

func (c *Client) GetCertMeta(id string) (*CertificateMeta, error)

GetCertMeta - get a specific cert's meta

PARAMS:

  • id: the specific cert's ID

RETURNS:

  • *CertificateMeta: the specific cert's meta with
  • error: nil if success otherwise the specific error

func (*Client) ListCertDetail added in v0.9.183

func (c *Client) ListCertDetail() (*ListCertDetailResult, error)

ListCertDetail - list all certs detail

RETURNS:

  • *ListCertDetailResult: the result of list all certs detail, contains all certs' meta detail
  • error: nil if success otherwise the specific error

func (*Client) ListCerts

func (c *Client) ListCerts() (*ListCertResult, error)

ListCerts - list all certs

RETURNS:

  • *ListCertResult: the result of list all certs, contains all certs' meta
  • error: nil if success otherwise the specific error

func (*Client) UpdateCertData

func (c *Client) UpdateCertData(id string, args *UpdateCertDataArgs) error

UpdateCertData - update a specific cert's data, include update key

PARAMS:

  • id: the specific cert's ID
  • args: the arguments to update a specific cert

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateCertName

func (c *Client) UpdateCertName(id string, args *UpdateCertNameArgs) error

UpdateCertName - update a cert's name

PARAMS:

  • id: the specific cert's ID
  • args: the arguments to update a cert's name

RETURNS:

  • error: nil if success otherwise the specific error

type CreateCertArgs

type CreateCertArgs struct {
	CertName        string `json:"certName"`
	CertServerData  string `json:"certServerData"`
	CertPrivateData string `json:"certPrivateData"`
	CertLinkData    string `json:"certLinkData,omitempty"`
	CertType        int    `json:"certType,omitempty"`
}

type CreateCertResult

type CreateCertResult struct {
	CertName string `json:"certName"`
	CertId   string `json:"certId"`
}

type ListCertDetailResult added in v0.9.183

type ListCertDetailResult struct {
	Certs []CertificateDetailMeta `json:"certs"`
}

type ListCertResult

type ListCertResult struct {
	Certs []CertificateMeta `json:"certs"`
}

type UpdateCertDataArgs

type UpdateCertDataArgs struct {
	CertName        string `json:"certName"`
	CertServerData  string `json:"certServerData"`
	CertPrivateData string `json:"certPrivateData"`
	CertLinkData    string `json:"certLinkData,omitempty"`
	CertType        int    `json:"certType,omitempty"`
}

type UpdateCertNameArgs

type UpdateCertNameArgs struct {
	CertName string `json:"certName"`
}

Jump to

Keyboard shortcuts

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