Documentation ¶
Index ¶
- Variables
- func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type BindHost
- type Certificate
- type CertificateDetail
- type CertificatePage
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
func List ¶
func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
List sends a request to obtain a certificate list
Types ¶
type Certificate ¶
type Certificate struct { // Certificate ID Id string `json:"id"` // Certificate Name Name string `json:"name"` // Certificate content Content string `json:"content"` // Certificate key Key string `json:"key"` // the time when the certificate expires in unix timestamp ExpireTime int `json:"expire_time"` // the time when the certificate is uploaded in unix timestamp TimeStamp int `json:"timestamp"` }
type CertificateDetail ¶
type CertificateDetail struct { // Certificate ID Id string `json:"id"` // Certificate Name Name string `json:"name"` // Certificate Id CertificateId string `json:"certificateid"` // Certificate name CertificateName string `json:"certificatename"` // the key of the certificate Timestamp int64 `json:"timestamp"` // the privite key of the certificate BindHosts []BindHost `json:"bind_host,omitempty"` // the time when the certificate expires in unix timestamp ExpireTime int `json:"expire_time"` // the expire status of the certificate // 0-not expired, 1-expired, 2-expired soon ExpStatus int `json:"exp_status"` }
CertificateDetail reprersents the result of list certificates.
func ExtractCertificates ¶
func ExtractCertificates(r pagination.Page) ([]CertificateDetail, error)
type CertificatePage ¶
type CertificatePage struct {
pagination.SinglePageBase
}
type CreateOpts ¶
type CreateOpts struct { // Certificate name Name string `json:"name" required:"true"` // Certificate content Content string `json:"content" required:"true"` // Private Key Key string `json:"key" required:"true"` // The ID of the enterprise project EnterpriseProjectId string `q:"enterprise_project_id" json:"-"` }
CreateOpts contains all the values needed to create a new certificate.
func (CreateOpts) ToCertCreateMap ¶
func (opts CreateOpts) ToCertCreateMap() (map[string]interface{}, error)
ToCertCreateMap builds a create 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 represents the result of a create operation. Call its Extract method to interpret it as a Certificate.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create will create a new certificate based on the values in CreateOpts.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a certificate.
type DeleteResult ¶
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)
Delete will permanently delete a particular certificate based on its unique ID.
func DeleteWithEpsID ¶
func DeleteWithEpsID(c *golangsdk.ServiceClient, id, epsID string) (r DeleteResult)
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Certificate.
func Get ¶
func Get(c *golangsdk.ServiceClient, id string) (r GetResult)
Get retrieves a particular certificate based on its unique ID.
func GetWithEpsID ¶
func GetWithEpsID(c *golangsdk.ServiceClient, id, epsID string) (r GetResult)
func (GetResult) Extract ¶
func (r GetResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a certificate.
type ListOpts ¶
type ListOpts struct { Page int `q:"page"` Pagesize int `q:"pagesize"` Name string `q:"name"` Host *bool `q:"host"` ExpStatus *int `q:"exp_status"` EnterpriseProjectID string `q:"enterprise_project_id"` }
ListOpts the struct is used to query certificate list
func (ListOpts) ToCertificateListQuery ¶
ToCertificateListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
type UpdateOpts ¶
type UpdateOpts struct { // Certificate name Name string `json:"name,omitempty"` // Certificate content Content string `json:"content,omitempty"` // Private Key Key string `json:"key,omitempty"` // The ID of the enterprise project EnterpriseProjectId string `q:"enterprise_project_id" json:"-"` }
UpdateOpts contains all the values needed to update a certificate.
func (UpdateOpts) ToCertUpdateMap ¶
func (opts UpdateOpts) ToCertUpdateMap() (map[string]interface{}, error)
ToCertUpdateMap builds a update request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a Certificate.
func Update ¶
func Update(c *golangsdk.ServiceClient, certID string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and uses the values to update a certificate.The response code from api is 200
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*Certificate, error)
Extract is a function that accepts a result and extracts a certificate.