export type CommonKeyValuePair = {key: string, value: string}; export type DboDatabaseSslConnectionMode = 'require' | 'verify-ca' | 'verify-full'; export type DboDatabaseSslOptionsUpdate = {sslMode?: DboDatabaseSslConnectionMode | undefined, sslCAPath?: string | undefined, sslKeyPath?: string | undefined, sslCertPath?: string | undefined}; export type DboDatabaseConnectionOptionsUpdate = {host?: string | undefined, port?: string | undefined, dbname?: string | undefined, encryptedCredentials?: string | undefined, user?: string | undefined, sslEnabled?: boolean | undefined, sslOptions?: DboDatabaseSslOptionsUpdate | undefined, cloudRegion?: string | undefined, bindings?: string | undefined, additionalOptions?: Array | undefined}; export type DboUpdateDatabaseRequest = {name?: string | undefined, configOptions?: Array | undefined, dbConnOptions?: DboDatabaseConnectionOptionsUpdate | undefined, tags?: Array | undefined, deployedOn?: Array | undefined}; export type PatchApiV1DboDatabasesEntityIdArgs = {entityId: string, body: DboUpdateDatabaseRequest}; export type PatchApiV1DboDatabasesEntityIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an observed database * * PATCH /v1/dbo/databases/{entityId} */ export const patchApiV1DboDatabasesEntityId = async (args: PatchApiV1DboDatabasesEntityIdArgs, options?: PatchApiV1DboDatabasesEntityIdOptions) => { const {baseUrl = "https://api.na-01.cloud.solarwinds.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/dbo/databases/${encodeURIComponent(String(args.entityId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };