JavaScript SDK
Certificates
TLS certificate management with automatic ACME issuance and load balancer integration
11 methods
listCertificates()
List certificates
Parameters
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
statusstring
- Filter by certificate status
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.listCertificates();console.log(result);
createCertificate()
Create certificate
Parameters
namestring
required- Name of the certificate
typestring
requireddomainsarray
- List of domains for ACME certificate (supports multi-domain and wildcard certs)
certificatestring
- PEM-encoded certificate (required when type is 'uploaded')
private_keystring
- PEM-encoded private key (required when type is 'uploaded')
chainstring
- PEM-encoded certificate chain (optional for uploaded certificates)
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.createCertificate({name: "my-certificate",type: "acme"});console.log(result);
getCertificate()
Get certificate
Parameters
certificate_idstring
required- Certificate ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.getCertificate({certificate_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
deleteCertificate()
Delete certificate
Parameters
certificate_idstring
required- Certificate ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.deleteCertificate({certificate_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
listBindings()
List certificate bindings
Parameters
certificate_idstring
required- Certificate ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.listBindings({certificate_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
createBinding()
Create certificate binding
Parameters
certificate_idstring
required- Certificate ID
resource_typestring
required- The type of resource to bind the certificate to
resource_idstring
required- The ID of the resource to bind to
optionsobject
- Binding options
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.createBinding({certificate_id: "550e8400-e29b-41d4-a716-446655440000",resource_type: "octavia:listener",resource_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
getBinding()
Get certificate binding
Parameters
certificate_idstring
required- Certificate ID
binding_idstring
required- Certificate Binding ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.getBinding({certificate_id: "550e8400-e29b-41d4-a716-446655440000",binding_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
deleteBinding()
Delete certificate binding
Parameters
certificate_idstring
required- Certificate ID
binding_idstring
required- Certificate Binding ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.deleteBinding({certificate_id: "550e8400-e29b-41d4-a716-446655440000",binding_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
renewCertificate()
Renew certificate
Parameters
certificate_idstring
required- Certificate ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.renewCertificate({certificate_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
validateCertificate()
Validate certificate DNS
Parameters
certificate_idstring
required- Certificate ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.validateCertificate({certificate_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);
listListenerCertificates()
List listener certificates
Parameters
load_balancer_idstring
required- Load Balancer ID
listener_idstring
required- Listener ID
Example
import { ByCloud } from "@bycoded/bycloud-sdk";const client = new ByCloud({token: "YOUR_ACCESS_TOKEN",});const result = await client.certificates.listListenerCertificates({load_balancer_id: "550e8400-e29b-41d4-a716-446655440000",listener_id: "550e8400-e29b-41d4-a716-446655440000"});console.log(result);