export type SupportPlan = 'basic' | 'developer pro' | 'enterprise'; export type SupportTimezone = 'ET' | 'GMT' | 'IST' | 'PT'; export type Support = {plan: SupportPlan, timezone?: SupportTimezone | undefined}; export type Compute = {cpu: number, ram: number}; export type DiskAWS = {type: 'gp3' | 'io2', storage: number, iops: number}; export type DiskAzure = {type: 'P6' | 'P10' | 'P15' | 'P20' | 'P30' | 'P40' | 'P50' | 'P60' | 'Ultra', storage?: (64 | 128 | 256 | 512 | 1024 | 2048 | 3072 | 4096 | 5120 | 6144 | 7168 | 8192 | 9216 | 10240 | 11264 | 12288 | 13312 | 14336 | 15360) | undefined, iops?: number | undefined, autoExpansion?: boolean | undefined}; export type DiskGCP = {type: 'pd-ssd', storage: number}; export type Node = {compute: Compute, disk: DiskAWS | DiskAzure | DiskGCP}; export type Service = 'data' | 'query' | 'index' | 'search' | 'analytics' | 'eventing'; export type ServiceGroup = {node?: Node | undefined, numOfNodes?: number | undefined, services?: Array | undefined}; export type UpdateClusterRequest = {name: string, description: string, support: Support, serviceGroups: Array}; export type UpdateApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdArgs = {'If-Match'?: string | undefined, body: UpdateClusterRequest}; export type UpdateApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdOptions = {baseUrl?: string | undefined, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Cluster * * PUT /v4/organizations/{organizationId}/projects/{projectId}/clusters/{clusterId} */ export const updateApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterId = async (args: UpdateApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdArgs, options?: UpdateApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdOptions) => { const {baseUrl = "https://cloudapi.cloud.couchbase.com", fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (token !== undefined) headers.set('authorization', `Bearer ${token}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/${encodeURIComponent(String(args.organizationId))}/projects/${encodeURIComponent(String(args.projectId))}/clusters/${encodeURIComponent(String(args.clusterId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };