Skip to content

cockroachdb/cockroach-cloud-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for CockroachDB Cloud API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2024-09-16
  • Package version: 5.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://support.cockroachlabs.com

Installation

Install the package:

go get github.com/cockroachdb/cockroach-cloud-sdk-go/v5

Import the package:

import "github.com/cockroachdb/cockroach-cloud-sdk-go/v5/pkg/client"

Example Client Usage

// Create a default Configuration object.
clientConfig := client.NewConfiguration(apiKey)

// Create a new client.
client := client.NewClient(clientConfig)

// Create a new service.
service := client.NewService(client)

requiredPathParam = "a_cluster_id"
requiredRequest := &client.OperationRequest{...}
optionalParams := &client.OperationOptions{...}

// Execute the request
apiResponse, httpResponse, err := := service.Operation(
	context.Background(), 
	requiredPathParam, 
	requiredRequest, 
	optionalParams,
)
if err != nil {
	// Process error
}

if apiResponse != nil {
	respJSON, err := apiResponse.MarshalJSON()
	if err != nil {
		// Process error
	}
	fmt.Println(string(respJSON))
}

Documentation for API Endpoints

All URIs are relative to https://cockroachlabs.cloud

API Method HTTP request Description
APIKeysApi CreateApiKey Post /api/v1/api-keys Create a new API Key
APIKeysApi DeleteApiKey Delete /api/v1/api-keys/{id} Delete an API Key
APIKeysApi GetApiKey Get /api/v1/api-keys/{id} Get an API Key by ID
APIKeysApi ListApiKeys Get /api/v1/api-keys List API Keys
APIKeysApi UpdateApiKey Patch /api/v1/api-keys/{id} Update an API Key
AuditLogsApi ListAuditLogs Get /api/v1/auditlogevents List audit logs
BackupRestoreApi GetBackupConfiguration Get /api/v1/clusters/{cluster_id}/backups-config Get the backup configuration for a cluster
BackupRestoreApi UpdateBackupConfiguration Patch /api/v1/clusters/{cluster_id}/backups-config Update the backup configuration for a cluster
BillingApi GetInvoice Get /api/v1/invoices/{invoice_id} Get a specific invoice for an organization
BillingApi ListInvoices Get /api/v1/invoices List invoices for a given organization
ClientCACertificatesApi DeleteClientCACert Delete /api/v1/clusters/{cluster_id}/client-ca-cert Delete Client CA Cert for a cluster
ClientCACertificatesApi GetClientCACert Get /api/v1/clusters/{cluster_id}/client-ca-cert Get Client CA Cert information for a cluster
ClientCACertificatesApi SetClientCACert Post /api/v1/clusters/{cluster_id}/client-ca-cert Set Client CA Cert for a cluster
ClientCACertificatesApi UpdateClientCACert Patch /api/v1/clusters/{cluster_id}/client-ca-cert Update Client CA Cert for a cluster
ClustersApi CreateCluster Post /api/v1/clusters Create and initialize a new cluster
ClustersApi DeleteCluster Delete /api/v1/clusters/{cluster_id} Delete a cluster and all of its data
ClustersApi GetCluster Get /api/v1/clusters/{cluster_id} Get extended information about a cluster
ClustersApi GetConnectionString Get /api/v1/clusters/{cluster_id}/connection-string Get a formatted generic connection string for a cluster
ClustersApi ListAvailableRegions Get /api/v1/clusters/available-regions List the regions available for new clusters and nodes
ClustersApi ListClusterNodes Get /api/v1/clusters/{cluster_id}/nodes List nodes for a cluster
ClustersApi ListClusters Get /api/v1/clusters List clusters owned by an organization
ClustersApi ListMajorClusterVersions Get /api/v1/cluster-versions List available major cluster versions
ClustersApi UpdateCluster Patch /api/v1/clusters/{cluster_id} Scale, edit or upgrade a cluster
CustomerManagedEncryptionKeysApi EnableCMEKSpec Post /api/v1/clusters/{cluster_id}/cmek Enable CMEK for a cluster
CustomerManagedEncryptionKeysApi GetCMEKClusterInfo Get /api/v1/clusters/{cluster_id}/cmek Get CMEK-related information for a cluster
CustomerManagedEncryptionKeysApi UpdateCMEKSpec Put /api/v1/clusters/{cluster_id}/cmek Enable or update the CMEK spec for a cluster
CustomerManagedEncryptionKeysApi UpdateCMEKStatus Patch /api/v1/clusters/{cluster_id}/cmek Update the CMEK-related status for a cluster
DatabasesApi CreateDatabase Post /api/v1/clusters/{cluster_id}/databases Create a new database
DatabasesApi DeleteDatabase Delete /api/v1/clusters/{cluster_id}/databases/{name} Delete a database
DatabasesApi EditDatabase Patch /api/v1/clusters/{cluster_id}/databases/{name} Update a database
DatabasesApi EditDatabase2 Patch /api/v1/clusters/{cluster_id}/databases Update a database
DatabasesApi ListDatabases Get /api/v1/clusters/{cluster_id}/databases List databases for a cluster
EgressRulesApi AddEgressRule Post /api/v1/clusters/{cluster_id}/networking/egress-rules Add an egress rule
EgressRulesApi DeleteEgressRule Delete /api/v1/clusters/{cluster_id}/networking/egress-rules/{rule_id} Delete an existing egress rule
EgressRulesApi EditEgressRule Patch /api/v1/clusters/{cluster_id}/networking/egress-rules/{rule_id} Edit an existing egress rule
EgressRulesApi GetEgressRule Get /api/v1/clusters/{cluster_id}/networking/egress-rules/{rule_id} Get an existing egress rule
EgressRulesApi ListEgressRules Get /api/v1/clusters/{cluster_id}/networking/egress-rules List all egress rules associated with a cluster
EgressRulesApi SetEgressTrafficPolicy Post /api/v1/clusters/{cluster_id}/networking/egress-rules/egress-traffic-policy Outbound traffic management
FoldersApi CreateFolder Post /api/v1/folders Create a folder
FoldersApi DeleteFolder Delete /api/v1/folders/{folder_id} Delete a folder
FoldersApi GetFolder Get /api/v1/folders/{folder_id} Get folder info for a folder
FoldersApi ListFolderContents Get /api/v1/folders/{folder_id}/contents List contents of a folder
FoldersApi ListFolders Get /api/v1/folders List folders owned by an organization
FoldersApi UpdateFolder Patch /api/v1/folders/{folder_id} Update a folder
IPAllowlistsApi AddAllowlistEntry Post /api/v1/clusters/{cluster_id}/networking/allowlist Add a new CIDR address to the IP allowlist
IPAllowlistsApi AddAllowlistEntry2 Put /api/v1/clusters/{cluster_id}/networking/allowlist/{cidr_ip}/{cidr_mask} Add a new CIDR address to the IP allowlist
IPAllowlistsApi DeleteAllowlistEntry Delete /api/v1/clusters/{cluster_id}/networking/allowlist/{cidr_ip}/{cidr_mask} Delete an IP allowlist entry
IPAllowlistsApi ListAllowlistEntries Get /api/v1/clusters/{cluster_id}/networking/allowlist Get the IP allowlist and propagation status for a cluster
IPAllowlistsApi UpdateAllowlistEntry Patch /api/v1/clusters/{cluster_id}/networking/allowlist/{cidr_ip}/{cidr_mask} Update an IP allowlist entry
JWTIssuersApi AddJWTIssuer Post /api/v1/jwt-issuers Add a JWT Issuer
JWTIssuersApi DeleteJWTIssuer Delete /api/v1/jwt-issuers/{id} Delete a JWT Issuer
JWTIssuersApi GetJWTIssuer Get /api/v1/jwt-issuers/{id} Get a JWT Issuer
JWTIssuersApi ListJWTIssuers Get /api/v1/jwt-issuers List all JWT Issuers
JWTIssuersApi UpdateJWTIssuer Patch /api/v1/jwt-issuers/{id} Update a JWT Issuer
LogExportApi DeleteLogExport Delete /api/v1/clusters/{cluster_id}/logexport Delete the Log Export configuration for a cluster
LogExportApi EnableLogExport Post /api/v1/clusters/{cluster_id}/logexport Create or update the Log Export configuration for a cluster
LogExportApi GetLogExportInfo Get /api/v1/clusters/{cluster_id}/logexport Get the Log Export configuration for a cluster
MaintenanceWindowsApi DeleteMaintenanceWindow Delete /api/v1/clusters/{cluster_id}/maintenance-window Delete the maintenance window for a cluster
MaintenanceWindowsApi GetMaintenanceWindow Get /api/v1/clusters/{cluster_id}/maintenance-window Get the maintenance window for a cluster
MaintenanceWindowsApi SetMaintenanceWindow Put /api/v1/clusters/{cluster_id}/maintenance-window Set the maintenance window for a cluster
MetricExportApi DeleteCloudWatchMetricExport Delete /api/v1/clusters/{cluster_id}/metricexport/cloudwatch Delete the CloudWatch Metric Export configuration for a cluster
MetricExportApi DeleteDatadogMetricExport Delete /api/v1/clusters/{cluster_id}/metricexport/datadog Delete the Datadog Metric Export configuration for a cluster
MetricExportApi DeletePrometheusMetricExport Delete /api/v1/clusters/{cluster_id}/metricexport/prometheus Disable Prometheus Metric Export for a cluster
MetricExportApi EnableCloudWatchMetricExport Post /api/v1/clusters/{cluster_id}/metricexport/cloudwatch Create or update the CloudWatch Metric Export configuration for a cluster
MetricExportApi EnableDatadogMetricExport Post /api/v1/clusters/{cluster_id}/metricexport/datadog Create or update the Datadog Metric Export configuration for a cluster
MetricExportApi EnablePrometheusMetricExport Post /api/v1/clusters/{cluster_id}/metricexport/prometheus Enable Prometheus Metric Export for a cluster
MetricExportApi GetCloudWatchMetricExportInfo Get /api/v1/clusters/{cluster_id}/metricexport/cloudwatch Get the CloudWatch Metric Export configuration for a cluster
MetricExportApi GetDatadogMetricExportInfo Get /api/v1/clusters/{cluster_id}/metricexport/datadog Get the Datadog Metric Export configuration for a cluster
MetricExportApi GetPrometheusMetricExportInfo Get /api/v1/clusters/{cluster_id}/metricexport/prometheus Get the Prometheus Metric Export configuration for a cluster
OpenIDConnectConfigurationApi CreateApiOidcConfig Post /api/v1/api_oidc Create an API OIDC configuration (Deprecated)
OpenIDConnectConfigurationApi DeleteApiOidcConfig Delete /api/v1/api_oidc/{id} Delete an API OIDC configuration (Deprecated)
OpenIDConnectConfigurationApi GetApiOidcConfig Get /api/v1/api_oidc/{id} Get an API OIDC configuration (Deprecated)
OpenIDConnectConfigurationApi ListApiOidcConfig Get /api/v1/api_oidc List all API OIDC configurations (Deprecated)
OpenIDConnectConfigurationApi UpdateApiOidcConfig Put /api/v1/api_oidc/{id} Update an API OIDC configuration (Deprecated)
OrganizationsApi GetOrganizationInfo Get /api/v1/organization Get information about the caller's organization
PrivateEndpointServicesApi AddPrivateEndpointConnection Post /api/v1/clusters/{cluster_id}/networking/private-endpoint-connections Add a connection to a cluster's private endpoint service.
PrivateEndpointServicesApi AddPrivateEndpointTrustedOwner Post /api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners Add a private endpoint trusted owner to a cluster
PrivateEndpointServicesApi CreatePrivateEndpointServices Post /api/v1/clusters/{cluster_id}/networking/private-endpoint-services Create all PrivateEndpointServices for a cluster
PrivateEndpointServicesApi DeletePrivateEndpointConnection Delete /api/v1/clusters/{cluster_id}/networking/private-endpoint-connections/{endpoint_id} Delete a connection from a cluster's private endpoint service.
PrivateEndpointServicesApi GetPrivateEndpointTrustedOwner Get /api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners/{owner_id} Get a private endpoint trusted owner entry for a cluster
PrivateEndpointServicesApi ListAwsEndpointConnections Get /api/v1/clusters/{cluster_id}/networking/aws-endpoint-connections List all AwsEndpointConnections for a cluster
PrivateEndpointServicesApi ListPrivateEndpointConnections Get /api/v1/clusters/{cluster_id}/networking/private-endpoint-connections List all connections to a cluster's private endpoint service.
PrivateEndpointServicesApi ListPrivateEndpointServices Get /api/v1/clusters/{cluster_id}/networking/private-endpoint-services List all PrivateEndpointServices for a cluster
PrivateEndpointServicesApi ListPrivateEndpointTrustedOwners Get /api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners List all private endpoint trusted owners for a cluster
PrivateEndpointServicesApi RemovePrivateEndpointTrustedOwner Delete /api/v1/clusters/{cluster_id}/networking/private-endpoint-trusted-owners/{owner_id} Remove a private endpoint trusted owner from a cluster
PrivateEndpointServicesApi SetAwsEndpointConnectionState Patch /api/v1/clusters/{cluster_id}/networking/aws-endpoint-connections/{endpoint_id} Set the AWS Endpoint Connection state
RoleManagementApi AddUserToRole Post /api/v1/roles/{user_id}/{resource_type}/{resource_id}/{role_name} Add a role to a user or service account
RoleManagementApi GetAllRolesForUser Get /api/v1/roles/{user_id} Get all Role Grants for a user
RoleManagementApi GetPersonUsersByEmail Get /api/v1/users/persons-by-email Search person users by email address
RoleManagementApi ListRoleGrants Get /api/v1/roles List all RoleGrants
RoleManagementApi RemoveUserFromRole Delete /api/v1/roles/{user_id}/{resource_type}/{resource_id}/{role_name} Remove a role from a user or service account
RoleManagementApi SetRolesForUser Put /api/v1/roles/{user_id} Replace the roles for a user or service account with exactly those provided
SCIMApi CreateGroup Post /api/scim/v2/Groups Create a group
SCIMApi CreateUser Post /api/scim/v2/Users Create a user
SCIMApi DeleteGroup Delete /api/scim/v2/Groups/{id} Delete a group based on ID
SCIMApi DeleteUser Delete /api/scim/v2/Users/{id} Delete a user based on ID
SCIMApi GetGroup Get /api/scim/v2/Groups/{id} Get a group by ID
SCIMApi GetGroup2 Put /api/scim/v2/Groups/{id}/.search Search a group by ID (Deprecated)
SCIMApi GetGroups Get /api/scim/v2/Groups List groups
SCIMApi GetGroups2 Put /api/scim/v2/Groups/.search Search groups (Deprecated)
SCIMApi GetResourceType Get /api/scim/v2/ResourceTypes/{resourceId} Get a SCIM resource type by ID
SCIMApi GetResourceTypes Get /api/scim/v2/ResourceTypes List the SCIM resource types
SCIMApi GetSchema Get /api/scim/v2/Schemas/{schemaId} Get a SCIM schema by ID
SCIMApi GetSchemas Get /api/scim/v2/Schemas List the SCIM schemas
SCIMApi GetServiceProviderConfig Get /api/scim/v2/ServiceProviderConfig Return the SCIM Service Provider configuration
SCIMApi GetUser Get /api/scim/v2/Users/{id} Get a user by ID
SCIMApi GetUser2 Put /api/scim/v2/Users/{id}/.search Search for a user by ID (Deprecated)
SCIMApi GetUsers Get /api/scim/v2/Users List Users
SCIMApi GetUsers2 Put /api/scim/v2/Users/.search Search User (Deprecated)
SCIMApi SearchGroup Post /api/scim/v2/Groups/{id}/.search Search a group by ID
SCIMApi SearchGroups Post /api/scim/v2/Groups/.search Search groups
SCIMApi SearchUser Post /api/scim/v2/Users/{id}/.search Search for a user by ID
SCIMApi SearchUsers Post /api/scim/v2/Users/.search Search Users
SCIMApi UpdateGroup Put /api/scim/v2/Groups/{id} Update a group by supplying all values of the user object
SCIMApi UpdateUser Put /api/scim/v2/Users/{id} Update a user by supplying all values of the user object
SQLUsersApi CreateSQLUser Post /api/v1/clusters/{cluster_id}/sql-users Create a new SQL user
SQLUsersApi DeleteSQLUser Delete /api/v1/clusters/{cluster_id}/sql-users/{name} Delete a SQL user
SQLUsersApi ListSQLUsers Get /api/v1/clusters/{cluster_id}/sql-users List SQL users for a cluster
SQLUsersApi UpdateSQLUserPassword Put /api/v1/clusters/{cluster_id}/sql-users/{name}/password Update a SQL user's password
ServiceAccountsApi CreateServiceAccount Post /api/v1/service-accounts Create a service account
ServiceAccountsApi DeleteServiceAccount Delete /api/v1/service-accounts/{id} Delete a service account
ServiceAccountsApi GetServiceAccount Get /api/v1/service-accounts/{id} Get a service account by ID
ServiceAccountsApi ListServiceAccounts Get /api/v1/service-accounts List service accounts for an organization
ServiceAccountsApi UpdateServiceAccount Patch /api/v1/service-accounts/{id} Update a service account
VersionDeferralApi GetClusterVersionDeferral Get /api/v1/clusters/{cluster_id}/version-deferral Get the version upgrade deferral policy for a cluster.
VersionDeferralApi SetClusterVersionDeferral Put /api/v1/clusters/{cluster_id}/version-deferral Set the version upgrade deferral policy for a cluster

Author

support@cockroachlabs.com