Skip to content

fix: export locality #2200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ export type { Money, ScwFile, TimeSeries } from './scw/custom-types'
export * as Errors from './scw/errors/standard'
export type { Region, Zone } from './scw/locality'
export * from './internals'
export { toApiLocality } from './scw/locality'
export type { ApiLocality } from './scw/locality'
21 changes: 16 additions & 5 deletions packages_generated/applesilicon/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
waitForResource,
} from '@scaleway/sdk-client'
import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client'
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import {
SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES as SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON,
SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON,
Expand Down Expand Up @@ -73,8 +74,13 @@ const jsonContentHeaders = {
This API allows you to manage your Apple silicon machines.
*/
export class API extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = ['fr-par-3']
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: ['fr-par-3'],
})

/**
* List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.
Expand Down Expand Up @@ -332,8 +338,13 @@ export class API extends ParentAPI {
* Apple silicon - Private Networks API.
*/
export class PrivateNetworkAPI extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = ['fr-par-1', 'fr-par-3']
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: ['fr-par-1', 'fr-par-3'],
})

getServerPrivateNetwork = (
request: Readonly<PrivateNetworkApiGetServerPrivateNetworkRequest>,
Expand Down
12 changes: 9 additions & 3 deletions packages_generated/audit_trail/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// If you have any remark or suggestion do not hesitate to open an issue.
import {
API as ParentAPI,
toApiLocality,
urlParams,
validatePathParam,
} from '@scaleway/sdk-client'
import type { Region as ScwRegion } from '@scaleway/sdk-client'
import type { ApiLocality } from '@scaleway/sdk-client'
import {
unmarshalListEventsResponse,
unmarshalListProductsResponse,
Expand All @@ -23,8 +24,13 @@ import type {
This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
*/
export class API extends ParentAPI {
/** Lists the available regions of the API. */
public static readonly LOCALITIES: ScwRegion[] = ['fr-par', 'nl-ams']
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
regions: ['fr-par', 'nl-ams'],
})

/**
* List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const unmarshalSecretManagerSecretInfo = (
}

return {
keyId: data.key_id,
path: data.path,
} as SecretManagerSecretInfo
}
Expand Down
1 change: 1 addition & 0 deletions packages_generated/audit_trail/src/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface KubernetesPoolInfo {

export interface SecretManagerSecretInfo {
path: string
keyId?: string
}

export interface SecretManagerSecretVersionInfo {
Expand Down
35 changes: 23 additions & 12 deletions packages_generated/baremetal/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
waitForResource,
} from '@scaleway/sdk-client'
import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client'
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import { SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_BAREMETAL } from './content.gen'
import {
marshalAddOptionServerRequest,
Expand Down Expand Up @@ -104,15 +105,20 @@ const jsonContentHeaders = {
This API allows you to manage your Elastic Metal servers.
*/
export class API extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = [
'fr-par-1',
'fr-par-2',
'nl-ams-1',
'nl-ams-2',
'pl-waw-2',
'pl-waw-3',
]
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: [
'fr-par-1',
'fr-par-2',
'nl-ams-1',
'nl-ams-2',
'pl-waw-2',
'pl-waw-3',
],
})

protected pageOfListServers = (request: Readonly<ListServersRequest> = {}) =>
this.client.fetch<ListServersResponse>(
Expand Down Expand Up @@ -690,8 +696,13 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass
* Elastic Metal - Private Network API.
*/
export class PrivateNetworkAPI extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = ['fr-par-2']
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: ['fr-par-2'],
})

/**
* Add a server to a Private Network.
Expand Down
26 changes: 16 additions & 10 deletions packages_generated/baremetal/src/v3/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
} from '@scaleway/sdk-client'
import type { Zone as ScwZone } from '@scaleway/sdk-client'
import type { ApiLocality } from '@scaleway/sdk-client'
import {
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
Expand All @@ -32,15 +33,20 @@ const jsonContentHeaders = {
* Elastic Metal - Private Networks API.
*/
export class PrivateNetworkAPI extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = [
'fr-par-1',
'fr-par-2',
'nl-ams-1',
'nl-ams-2',
'pl-waw-2',
'pl-waw-3',
]
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: [
'fr-par-1',
'fr-par-2',
'nl-ams-1',
'nl-ams-2',
'pl-waw-2',
'pl-waw-3',
],
})

/**
* Add a server to a Private Network. Add an Elastic Metal server to a Private Network.
Expand Down
32 changes: 19 additions & 13 deletions packages_generated/block/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
waitForResource,
} from '@scaleway/sdk-client'
import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client'
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import {
SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK,
VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK,
Expand Down Expand Up @@ -56,18 +57,23 @@ const jsonContentHeaders = {
This API allows you to manage your Block Storage volumes.
*/
export class API extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = [
'fr-par-1',
'fr-par-2',
'fr-par-3',
'nl-ams-1',
'nl-ams-2',
'nl-ams-3',
'pl-waw-1',
'pl-waw-2',
'pl-waw-3',
]
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: [
'fr-par-1',
'fr-par-2',
'fr-par-3',
'nl-ams-1',
'nl-ams-2',
'nl-ams-3',
'pl-waw-1',
'pl-waw-2',
'pl-waw-3',
],
})

protected pageOfListVolumeTypes = (
request: Readonly<ListVolumeTypesRequest> = {},
Expand Down
32 changes: 19 additions & 13 deletions packages_generated/block/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
waitForResource,
} from '@scaleway/sdk-client'
import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client'
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client'
import {
SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK,
VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK,
Expand Down Expand Up @@ -58,18 +59,23 @@ const jsonContentHeaders = {
This API allows you to manage your Block Storage volumes.
*/
export class API extends ParentAPI {
/** Lists the available zones of the API. */
public static readonly LOCALITIES: ScwZone[] = [
'fr-par-1',
'fr-par-2',
'fr-par-3',
'nl-ams-1',
'nl-ams-2',
'nl-ams-3',
'pl-waw-1',
'pl-waw-2',
'pl-waw-3',
]
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
zones: [
'fr-par-1',
'fr-par-2',
'fr-par-3',
'nl-ams-1',
'nl-ams-2',
'nl-ams-3',
'pl-waw-1',
'pl-waw-2',
'pl-waw-3',
],
})

protected pageOfListVolumeTypes = (
request: Readonly<ListVolumeTypesRequest> = {},
Expand Down
28 changes: 13 additions & 15 deletions packages_generated/cockpit/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import {
API as ParentAPI,
enrichForPagination,
toApiLocality,
urlParams,
validatePathParam,
} from '@scaleway/sdk-client'
import type { Region as ScwRegion } from '@scaleway/sdk-client'
import type { ApiLocality } from '@scaleway/sdk-client'
import {
marshalGlobalApiCreateGrafanaUserRequest,
marshalGlobalApiResetGrafanaUserPasswordRequest,
Expand Down Expand Up @@ -386,12 +387,13 @@ Deprecated: retention is now managed at the data source level.
The Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager.
*/
export class RegionalAPI extends ParentAPI {
/** Lists the available regions of the API. */
public static readonly LOCALITIES: ScwRegion[] = [
'fr-par',
'nl-ams',
'pl-waw',
]
/**
* Locality of this API.
* type ∈ {'zone','region','global','unspecified'}
*/
public static readonly LOCALITY: ApiLocality = toApiLocality({
regions: ['fr-par', 'nl-ams', 'pl-waw'],
})

/**
* Get the Cockpit configuration.
Expand All @@ -409,10 +411,7 @@ export class RegionalAPI extends ParentAPI {
)

/**
* Create a data source. You must specify the data source type upon creation. Available data source types include:
- metrics
- logs
- traces
* Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation.
The name of the data source will then be used as reference to name the associated Grafana data source.
*
* @param request - The request {@link RegionalApiCreateDataSourceRequest}
Expand Down Expand Up @@ -450,7 +449,7 @@ The name of the data source will then be used as reference to name the associate
)

/**
* Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.
* Delete a data source. Delete a given data source. Note that this action will permanently delete this data source and any data associated with it.
*
* @param request - The request {@link RegionalApiDeleteDataSourceRequest}
*/
Expand Down Expand Up @@ -487,7 +486,6 @@ The name of the data source will then be used as reference to name the associate

/**
* List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order.
You can list data sources by Project, type and origin.
*
* @param request - The request {@link RegionalApiListDataSourcesRequest}
* @returns A Promise of ListDataSourcesResponse
Expand All @@ -497,7 +495,7 @@ You can list data sources by Project, type and origin.
) => enrichForPagination('dataSources', this.pageOfListDataSources, request)

/**
* Update a data source. Update a given data source name, specified by the data source ID.
* Update a data source. Update a given data source attributes (name and/or retention_days).
*
* @param request - The request {@link RegionalApiUpdateDataSourceRequest}
* @returns A Promise of DataSource
Expand All @@ -519,7 +517,7 @@ You can list data sources by Project, type and origin.
)

/**
* Get data source usage overview. Retrieve the data source usage overview per type for the specified Project.
* Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region.
*
* @param request - The request {@link RegionalApiGetUsageOverviewRequest}
* @returns A Promise of UsageOverview
Expand Down
Loading
Loading