github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/apigw/v2/domain/GetCertificate.go (about)

     1  package domain
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func GetCertificate(client *golangsdk.ServiceClient, opts CertificateOpts) (*Certificate, error) {
     9  	// GET /v2/{project_id}/apigw/instances/{instance_id}/api-groups/{group_id}/domains/{domain_id}/certificate/{certificate_id}
    10  	raw, err := client.Get(client.ServiceURL("apigw", "instances", opts.GatewayID, "api-groups", opts.GroupID, "domains", opts.DomainID, "certificate", opts.CertificateID), nil, nil)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	var res Certificate
    16  	err = extract.Into(raw.Body, &res)
    17  	return &res, err
    18  }
    19  
    20  type Certificate struct {
    21  	// Certificate ID.
    22  	ID string `json:"id"`
    23  	// Certificate name.
    24  	Name string `json:"name"`
    25  	// Certificate type. Options:
    26  	// global: Global certificate.
    27  	// instance: Gateway certificate.
    28  	Type string `json:"type"`
    29  	// Gateway ID.
    30  	// If type is set to global, the default value is common.
    31  	// If type is set to instance, a gateway ID is displayed.
    32  	GatewayId string `json:"instance_id"`
    33  	// Project ID.
    34  	ProjectId string `json:"project_id"`
    35  	// Creation time.
    36  	CreatedAt string `json:"create_time"`
    37  	// Update time.
    38  	UpdatedAt string `json:"update_time"`
    39  	// Certificate domain name.
    40  	CommonName string `json:"common_name"`
    41  	// Subject alternative names.
    42  	San []string `json:"san"`
    43  	// Certificate version.
    44  	Version int `json:"version"`
    45  	// Company or organization.
    46  	Organization []string `json:"organization"`
    47  	// Department.
    48  	OrganizationalUnit []string `json:"organizational_unit"`
    49  	// City.
    50  	City []string `json:"locality"`
    51  	// State or province.
    52  	State []string `json:"state"`
    53  	// Country or region.
    54  	Country []string `json:"country"`
    55  	// Start time of the certificate validity period.
    56  	NotBefore string `json:"not_before"`
    57  	// End time of the certificate validity period.
    58  	NotAfter string `json:"not_after"`
    59  	// Serial No.
    60  	SerialNumber string `json:"serial_number"`
    61  	// Certificate issuer.
    62  	Issuer []string `json:"issuer"`
    63  	// Signature algorithm.
    64  	SignatureAlgorithm string `json:"signature_algorithm"`
    65  }