Skip to content

Commit cbd4509

Browse files
feat(mongodb): add DeleteEndpoint (#1575)
Co-authored-by: Jules Castéran <jcasteran@scaleway.com>
1 parent 54c1f2e commit cbd4509

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

packages/clients/src/api/mongodb/v1alpha1/api.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import type {
3434
CreateInstanceRequest,
3535
CreateSnapshotRequest,
3636
CreateUserRequest,
37+
DeleteEndpointRequest,
3738
DeleteInstanceRequest,
3839
DeleteSnapshotRequest,
3940
GetInstanceCertificateRequest,
@@ -521,4 +522,18 @@ export class API extends ParentAPI {
521522
},
522523
unmarshalUser,
523524
)
525+
526+
/**
527+
* Delete a Database Instance endpoint. Delete the endpoint of a Database
528+
* Instance. You must specify the `endpoint_id` parameter of the endpoint you
529+
* want to delete. Note that you might need to update any environment
530+
* configurations that point to the deleted endpoint.
531+
*
532+
* @param request - The request {@link DeleteEndpointRequest}
533+
*/
534+
deleteEndpoint = (request: Readonly<DeleteEndpointRequest>) =>
535+
this.client.fetch<void>({
536+
method: 'DELETE',
537+
path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`,
538+
})
524539
}

packages/clients/src/api/mongodb/v1alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type {
77
CreateInstanceRequestVolumeDetails,
88
CreateSnapshotRequest,
99
CreateUserRequest,
10+
DeleteEndpointRequest,
1011
DeleteInstanceRequest,
1112
DeleteSnapshotRequest,
1213
Endpoint,

packages/clients/src/api/mongodb/v1alpha1/types.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,16 @@ export type CreateUserRequest = {
314314
password: string
315315
}
316316

317+
export type DeleteEndpointRequest = {
318+
/**
319+
* Region to target. If none is passed will use default region from the
320+
* config.
321+
*/
322+
region?: Region
323+
/** UUID of the Endpoint to delete. */
324+
endpointId: string
325+
}
326+
317327
export type DeleteInstanceRequest = {
318328
/**
319329
* Region to target. If none is passed will use default region from the

0 commit comments

Comments
 (0)