Skip to main content

List

Returns the list of certificates in the specified folder.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const CertificateView =
cloudApi.certificatemanager.certificate_service.CertificateView;
const ListCertificatesRequest =
cloudApi.certificatemanager.certificate_service.ListCertificatesRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.CertificateServiceClient);

const result = await client.list(
ListCertificatesRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// view: CertificateView.FULL
})
);
console.log(result);
})();

ListCertificatesRequest

folderId : string

ID of the folder to list certificate in.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListCertificatesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.

pageToken : string

Page token. To get the next page of results, set page_token to the ListCertificatesResponse.next_page_token returned by a previous list request.

view : CertificateView

The output type of the certificate.

ListCertificatesResponse

certificates : Certificate

List of certificates in the specified folder.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is greater than the specified ListCertificatesRequest.page_size, use the next_page_token as the value for the ListCertificatesRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Certificate

A certificate. For details about the concept, see documentation.

Status
  • STATUS_UNSPECIFIED

  • VALIDATING

    The certificate domains validation are required. Used only for managed certificates.

  • INVALID

    The certificate issuance is failed. Used only for managed certificates.

  • ISSUED

    The certificate is issued.

  • REVOKED

    The certificate is revoked.

  • RENEWING

    The certificate renewal is started. Used only for managed certificates.

  • RENEWAL_FAILED

    The certificate renewal is failed. Used only for managed certificates.

id : string

ID of the certificate. Generated at creation time.

folderId : string

ID of the folder that the certificate belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

name : string

Name of the certificate. The name is unique within the folder.

description : string

Description of the certificate.

labels : string

Certificate labels as key:value pairs.

type : CertificateType

Type of the certificate.

domains : string

Fully qualified domain names of the certificate.

status : Status

Status of the certificate.

issuer : string

Distinguished Name of the certificate authority that issued the certificate.

subject : string

Distinguished Name of the entity that is associated with the public key contained in the certificate.

serial : string

Serial number of the certificate.

updatedAt : google.protobuf.Timestamp

Time when the certificate is updated.

issuedAt : google.protobuf.Timestamp

Time when the certificate is issued.

notAfter : google.protobuf.Timestamp

Time after which the certificate is not valid.

notBefore : google.protobuf.Timestamp

Time before which the certificate is not valid.

challenges : Challenge

Domains validation challenges of the certificate. Used only for managed certificates.

deletionProtection : bool

Flag that protects deletion of the certificate

incompleteChain : bool

Mark imported certificates without uploaded chain or with chain which not lead to root certificate

Challenge

Domain validation challenge.

Status
  • STATUS_UNSPECIFIED

  • PENDING

    The challenge is waiting to be completed.

  • PROCESSING

    The challenge is awaiting approval from Let's Encrypt.

  • VALID

    The challenge is complete.

  • INVALID

    The rights check for a specific domain failed or the one-week period allocated for the check expired.

DnsRecord
name : string

Name of the DNS record.

type : string

Type of the DNS-record.

value : string

Value of the DNS-record.

HttpFile
url : string

Location of the HTTP file.

content : string

Content of the HTTP file.

domain : string

Domain of the challenge.

type : ChallengeType

Type of the challenge.

createdAt : google.protobuf.Timestamp

Time when the challenge is created.

updatedAt : google.protobuf.Timestamp

Time when the challenge is updated.

status : Status

Status of the challenge.

message : string

Description of the challenge.

error : string

Error of the challenge.

One of challenge

Data of the challenge.

  • dnsChallenge : DnsRecord

    DNS-record.

  • httpChallenge : HttpFile

    HTTP-file.

DnsRecord

name : string

Name of the DNS record.

type : string

Type of the DNS-record.

value : string

Value of the DNS-record.

HttpFile

url : string

Location of the HTTP file.

content : string

Content of the HTTP file.