Skip to content

Commit

Permalink
feat(mongodb): add DeleteEndpoint (#1575)
Browse files Browse the repository at this point in the history
Co-authored-by: Jules Castéran <jcasteran@scaleway.com>
  • Loading branch information
scaleway-bot and Codelax authored Nov 18, 2024
1 parent 54c1f2e commit cbd4509
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/clients/src/api/mongodb/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type {
CreateInstanceRequest,
CreateSnapshotRequest,
CreateUserRequest,
DeleteEndpointRequest,
DeleteInstanceRequest,
DeleteSnapshotRequest,
GetInstanceCertificateRequest,
Expand Down Expand Up @@ -521,4 +522,18 @@ export class API extends ParentAPI {
},
unmarshalUser,
)

/**
* Delete a Database Instance endpoint. Delete the endpoint of a Database
* Instance. You must specify the `endpoint_id` parameter of the endpoint you
* want to delete. Note that you might need to update any environment
* configurations that point to the deleted endpoint.
*
* @param request - The request {@link DeleteEndpointRequest}
*/
deleteEndpoint = (request: Readonly<DeleteEndpointRequest>) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`,
})
}
1 change: 1 addition & 0 deletions packages/clients/src/api/mongodb/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type {
CreateInstanceRequestVolumeDetails,
CreateSnapshotRequest,
CreateUserRequest,
DeleteEndpointRequest,
DeleteInstanceRequest,
DeleteSnapshotRequest,
Endpoint,
Expand Down
10 changes: 10 additions & 0 deletions packages/clients/src/api/mongodb/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ export type CreateUserRequest = {
password: string
}

export type DeleteEndpointRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
/** UUID of the Endpoint to delete. */
endpointId: string
}

export type DeleteInstanceRequest = {
/**
* Region to target. If none is passed will use default region from the
Expand Down

0 comments on commit cbd4509

Please sign in to comment.