diff --git a/packages_generated/applesilicon/src/v1alpha1/api.gen.ts b/packages_generated/applesilicon/src/v1alpha1/api.gen.ts index 864aea0ec..84f054a33 100644 --- a/packages_generated/applesilicon/src/v1alpha1/api.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/api.gen.ts @@ -3,49 +3,55 @@ import { API as ParentAPI, enrichForPagination, - toApiLocality, urlParams, validatePathParam, waitForResource, + toApiLocality, } 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, -} from './content.gen.js' +import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' +import {RUNNER_TRANSIENT_STATUSES as RUNNER_TRANSIENT_STATUSES_APPLESILICON,SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES as SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON,SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON,} from './content.gen.js' import { marshalBatchCreateServersRequest, - marshalCreateServerRequest, - marshalPrivateNetworkApiAddServerPrivateNetworkRequest, - marshalPrivateNetworkApiSetServerPrivateNetworksRequest, - marshalReinstallServerRequest, - marshalStartConnectivityDiagnosticRequest, - marshalUpdateServerRequest, unmarshalBatchCreateServersResponse, unmarshalConnectivityDiagnostic, + marshalCreateRunnerRequest, + marshalCreateServerRequest, unmarshalListOSResponse, + unmarshalListRunnersResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, + marshalPrivateNetworkApiAddServerPrivateNetworkRequest, + marshalPrivateNetworkApiSetServerPrivateNetworksRequest, + marshalReinstallServerRequest, + unmarshalRunner, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalServerType, unmarshalSetServerPrivateNetworksResponse, + marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, + marshalUpdateRunnerRequest, + marshalUpdateServerRequest, } from './marshalling.gen.js' import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, + CreateRunnerRequest, CreateServerRequest, + DeleteRunnerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, + GetRunnerRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, + ListRunnersRequest, + ListRunnersResponse, ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, @@ -59,12 +65,14 @@ import type { PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, + Runner, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, + UpdateRunnerRequest, UpdateServerRequest, } from './types.gen.js' @@ -82,10 +90,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = toApiLocality({ - zones: ['fr-par-3'], - }) - + 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`. * @@ -101,6 +112,7 @@ export class API extends ParentAPI { unmarshalListServerTypesResponse, ) + /** * Get a server type. Get technical details (CPU, disk size etc.) of a server type. * @@ -116,6 +128,7 @@ export class API extends ParentAPI { unmarshalServerType, ) + /** * Create a server. Create a new server in the targeted zone, specifying its configuration including name and type. * @@ -135,6 +148,7 @@ export class API extends ParentAPI { unmarshalServer, ) + /** * Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fulfilled, no servers are created. * @@ -154,6 +168,7 @@ export class API extends ParentAPI { unmarshalBatchCreateServersResponse, ) + protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -163,16 +178,13 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ), }, unmarshalListServersResponse, ) - + /** * List all servers. List all servers in the specified zone. By default, returned servers in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -182,6 +194,7 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) + protected pageOfListOS = (request: Readonly = {}) => this.client.fetch( { @@ -190,16 +203,13 @@ export class API extends ParentAPI { urlParams: urlParams( ['name', request.name], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['server_type', request.serverType], ), }, unmarshalListOSResponse, ) - + /** * List all Operating Systems (OS). List all Operating Systems (OS). The response will include the total number of OS as well as their associated IDs, names and labels. * @@ -209,6 +219,7 @@ export class API extends ParentAPI { listOS = (request: Readonly = {}) => enrichForPagination('os', this.pageOfListOS, request) + /** * Get an Operating System (OS). Get an Operating System (OS). The response will include the OS's unique ID as well as its name and label. * @@ -224,6 +235,7 @@ export class API extends ParentAPI { unmarshalOS, ) + /** * Get a server. Retrieve information about an existing Apple silicon server, specified by its server ID. Its full details, including name, status and IP address, are returned in the response object. * @@ -238,7 +250,7 @@ export class API extends ParentAPI { }, unmarshalServer, ) - + /** * Waits for {@link Server} to be in a final state. * @@ -251,16 +263,13 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? - (res => - Promise.resolve( - !SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status), - )), + options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), this.getServer, request, options, ) + /** * Update a server. Update the parameters of an existing Apple silicon server, specified by its server ID. * @@ -280,17 +289,21 @@ export class API extends ParentAPI { unmarshalServer, ) + /** * Delete a server. Delete an existing Apple silicon server, specified by its server ID. Deleting a server is permanent, and cannot be undone. Note that the minimum allocation period for Apple silicon-as-a-service is 24 hours, meaning you cannot delete your server prior to that. * * @param request - The request {@link DeleteServerRequest} */ deleteServer = (request: Readonly) => - this.client.fetch({ - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, - }) + this.client.fetch( + { + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, + }, + ) + /** * Reboot a server. Reboot an existing Apple silicon server, specified by its server ID. * @@ -308,6 +321,7 @@ export class API extends ParentAPI { unmarshalServer, ) + /** * Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the default configuration values of the image (OS). * @@ -327,16 +341,12 @@ export class API extends ParentAPI { unmarshalServer, ) - startConnectivityDiagnostic = ( - request: Readonly, - ) => + + startConnectivityDiagnostic = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalStartConnectivityDiagnosticRequest( - request, - this.client.settings, - ), + marshalStartConnectivityDiagnosticRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'POST', @@ -345,9 +355,8 @@ export class API extends ParentAPI { unmarshalStartConnectivityDiagnosticResponse, ) - getConnectivityDiagnostic = ( - request: Readonly, - ) => + + getConnectivityDiagnostic = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -355,6 +364,122 @@ export class API extends ParentAPI { }, unmarshalConnectivityDiagnostic, ) + + + /** + * Create a new runner configuration. + * + * @param request - The request {@link CreateRunnerRequest} + * @returns A Promise of Runner + */ + createRunner = (request: Readonly) => + this.client.fetch( + { + body: JSON.stringify( + marshalCreateRunnerRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners`, + }, + unmarshalRunner, + ) + + + /** + * Retrieve a runner configuration. + * + * @param request - The request {@link GetRunnerRequest} + * @returns A Promise of Runner + */ + getRunner = (request: Readonly) => + this.client.fetch( + { + method: 'GET', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam('runnerId', request.runnerId)}`, + }, + unmarshalRunner, + ) + + /** + * Waits for {@link Runner} to be in a final state. + * + * @param request - The request {@link GetRunnerRequest} + * @param options - The waiting options + * @returns A Promise of Runner + */ + waitForRunner = ( + request: Readonly, + options?: Readonly>, + ) => + waitForResource( + options?.stop ?? (res => Promise.resolve(!RUNNER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), + this.getRunner, + request, + options, + ) + + + protected pageOfListRunners = (request: Readonly = {}) => + this.client.fetch( + { + method: 'GET', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners`, + urlParams: urlParams( + ['organization_id', request.organizationId], + ['page', request.page], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + ['project_id', request.projectId], + ['server_id', request.serverId], + ), + }, + unmarshalListRunnersResponse, + ) + + /** + * List runner configurations associated with a server. + * + * @param request - The request {@link ListRunnersRequest} + * @returns A Promise of ListRunnersResponse + */ + listRunners = (request: Readonly = {}) => + enrichForPagination('runners', this.pageOfListRunners, request) + + + /** + * Create a new runner configuration. + * + * @param request - The request {@link UpdateRunnerRequest} + * @returns A Promise of Runner + */ + updateRunner = (request: Readonly) => + this.client.fetch( + { + body: JSON.stringify( + marshalUpdateRunnerRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'PATCH', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam('runnerId', request.runnerId)}`, + }, + unmarshalRunner, + ) + + + /** + * Create a new runner configuration. + * + * @param request - The request {@link DeleteRunnerRequest} + */ + deleteRunner = (request: Readonly) => + this.client.fetch( + { + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam('runnerId', request.runnerId)}`, + }, + ) + + } /** @@ -365,13 +490,15 @@ export class PrivateNetworkAPI extends ParentAPI { * 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, - ) => + public static readonly LOCALITY: ApiLocality = + toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-3', + ], + }) + + getServerPrivateNetwork = (request: Readonly) => this.client.fetch( { method: 'GET', @@ -379,7 +506,7 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalServerPrivateNetwork, ) - + /** * Waits for {@link ServerPrivateNetwork} to be in a final state. * @@ -392,34 +519,24 @@ export class PrivateNetworkAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? - (res => - Promise.resolve( - !SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON.includes( - res.status, - ), - )), + options?.stop ?? (res => Promise.resolve(!SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), this.getServerPrivateNetwork, request, options, ) + /** * Add a server to a Private Network. Add an Apple silicon server to a Private Network. * * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest} * @returns A Promise of ServerPrivateNetwork */ - addServerPrivateNetwork = ( - request: Readonly, - ) => + addServerPrivateNetwork = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiAddServerPrivateNetworkRequest( - request, - this.client.settings, - ), + marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'POST', @@ -428,22 +545,18 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalServerPrivateNetwork, ) + /** * Set multiple Private Networks on a server. Configure multiple Private Networks on an Apple silicon server. * * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest} * @returns A Promise of SetServerPrivateNetworksResponse */ - setServerPrivateNetworks = ( - request: Readonly, - ) => + setServerPrivateNetworks = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiSetServerPrivateNetworksRequest( - request, - this.client.settings, - ), + marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'PUT', @@ -452,9 +565,8 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalSetServerPrivateNetworksResponse, ) - protected pageOfListServerPrivateNetworks = ( - request: Readonly = {}, - ) => + + protected pageOfListServerPrivateNetworks = (request: Readonly = {}) => this.client.fetch( { method: 'GET', @@ -464,10 +576,7 @@ export class PrivateNetworkAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId], @@ -475,32 +584,30 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalListServerPrivateNetworksResponse, ) - + /** * List the Private Networks of a server. List the Private Networks of an Apple silicon server. * * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest} * @returns A Promise of ListServerPrivateNetworksResponse */ - listServerPrivateNetworks = ( - request: Readonly = {}, - ) => - enrichForPagination( - 'serverPrivateNetworks', - this.pageOfListServerPrivateNetworks, - request, - ) + listServerPrivateNetworks = (request: Readonly = {}) => + enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request) + /** * Delete a Private Network. * * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} */ - deleteServerPrivateNetwork = ( - request: Readonly, - ) => - this.client.fetch({ - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }) + deleteServerPrivateNetwork = (request: Readonly) => + this.client.fetch( + { + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }, + ) + + } + diff --git a/packages_generated/applesilicon/src/v1alpha1/content.gen.ts b/packages_generated/applesilicon/src/v1alpha1/content.gen.ts index 59af5589e..f72d70483 100644 --- a/packages_generated/applesilicon/src/v1alpha1/content.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/content.gen.ts @@ -1,18 +1,28 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import type { + RunnerStatus, ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus, } from './types.gen.js' + +/** Lists transient statutes of the enum {@link RunnerStatus}. */ +export const RUNNER_TRANSIENT_STATUSES: RunnerStatus[] = [ + 'waiting', +] + /** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */ -export const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[] = - ['attaching', 'detaching'] +export const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[] = [ + 'attaching', + 'detaching', +] /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ -export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = - ['vpc_updating'] +export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = [ + 'vpc_updating', +] /** Lists transient statutes of the enum {@link ServerStatus}. */ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ @@ -24,3 +34,4 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ 'reinstalling', 'busy', ] + diff --git a/packages_generated/applesilicon/src/v1alpha1/index.gen.ts b/packages_generated/applesilicon/src/v1alpha1/index.gen.ts index 242faaf31..6452b34b6 100644 --- a/packages_generated/applesilicon/src/v1alpha1/index.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/index.gen.ts @@ -7,6 +7,7 @@ export { export * from './content.gen.js' export * from './marshalling.gen.js' export type { + AppliedRunnerConfigurations, BatchCreateServersRequest, BatchCreateServersRequestBatchInnerCreateServerRequest, BatchCreateServersResponse, @@ -17,14 +18,21 @@ export type { ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, + CreateRunnerRequest, CreateServerRequest, + DeleteRunnerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, + GetRunnerRequest, GetServerRequest, GetServerTypeRequest, + GithubRunnerConfiguration, + GitlabRunnerConfiguration, ListOSRequest, ListOSResponse, + ListRunnersRequest, + ListRunnersResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServerTypesRequest, @@ -41,8 +49,12 @@ export type { PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, + Runner, RunnerConfiguration, RunnerConfigurationProvider, + RunnerConfigurationV2, + RunnerConfigurationV2Provider, + RunnerStatus, Server, ServerPrivateNetwork, ServerPrivateNetworkServerStatus, @@ -59,5 +71,7 @@ export type { SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, + UpdateRunnerRequest, UpdateServerRequest, } from './types.gen.js' +export * as ValidationRules from './validation-rules.gen.js' diff --git a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts index b69079312..7da93d6f3 100644 --- a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts @@ -1,49 +1,51 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { - isJSONObject, - unmarshalArrayOfObject, - unmarshalDate, -} from '@scaleway/sdk-client' +import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { - BatchCreateServersRequest, - BatchCreateServersRequestBatchInnerCreateServerRequest, - BatchCreateServersResponse, - Commitment, - CommitmentTypeValue, - ConnectivityDiagnostic, - ConnectivityDiagnosticServerHealth, - CreateServerRequest, - ListOSResponse, - ListServerPrivateNetworksResponse, - ListServerTypesResponse, - ListServersResponse, - OS, OSSupportedServerType, - PrivateNetworkApiAddServerPrivateNetworkRequest, - PrivateNetworkApiSetServerPrivateNetworksRequest, - ReinstallServerRequest, + OS, + Commitment, RunnerConfiguration, Server, + GithubRunnerConfiguration, + GitlabRunnerConfiguration, + RunnerConfigurationV2, + Runner, ServerPrivateNetwork, - ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNPU, ServerTypeNetwork, + ServerType, + BatchCreateServersResponse, + ConnectivityDiagnosticServerHealth, + ConnectivityDiagnostic, + ListOSResponse, + ListRunnersResponse, + ListServerPrivateNetworksResponse, + ListServerTypesResponse, + ListServersResponse, SetServerPrivateNetworksResponse, - StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, + BatchCreateServersRequestBatchInnerCreateServerRequest, + BatchCreateServersRequest, + CreateRunnerRequest, + AppliedRunnerConfigurations, + CreateServerRequest, + PrivateNetworkApiAddServerPrivateNetworkRequest, + PrivateNetworkApiSetServerPrivateNetworksRequest, + ReinstallServerRequest, + StartConnectivityDiagnosticRequest, + UpdateRunnerRequest, + CommitmentTypeValue, UpdateServerRequest, } from './types.gen.js' -const unmarshalOSSupportedServerType = ( - data: unknown, -): OSSupportedServerType => { +const unmarshalOSSupportedServerType = (data: unknown): OSSupportedServerType => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`, @@ -64,9 +66,7 @@ export const unmarshalOS = (data: unknown): OS => { } return { - compatibleServerTypes: data.compatible_server_types - ? data.compatible_server_types - : undefined, + compatibleServerTypes: data.compatible_server_types ? data.compatible_server_types : undefined, description: data.description, family: data.family, id: data.id, @@ -75,10 +75,7 @@ export const unmarshalOS = (data: unknown): OS => { label: data.label, name: data.name, releaseNotesUrl: data.release_notes_url, - supportedServerTypes: unmarshalArrayOfObject( - data.supported_server_types, - unmarshalOSSupportedServerType, - ), + supportedServerTypes: unmarshalArrayOfObject(data.supported_server_types, unmarshalOSSupportedServerType), tags: data.tags, version: data.version, xcodeVersion: data.xcode_version, @@ -121,9 +118,8 @@ export const unmarshalServer = (data: unknown): Server => { } return { - commitment: data.commitment - ? unmarshalCommitment(data.commitment) - : undefined, + appliedRunnerConfigurationIds: data.applied_runner_configuration_ids, + commitment: data.commitment ? unmarshalCommitment(data.commitment) : undefined, createdAt: unmarshalDate(data.created_at), deletableAt: unmarshalDate(data.deletable_at), deletionScheduled: data.deletion_scheduled, @@ -135,9 +131,7 @@ export const unmarshalServer = (data: unknown): Server => { os: data.os ? unmarshalOS(data.os) : undefined, projectId: data.project_id, publicBandwidthBps: data.public_bandwidth_bps, - runnerConfiguration: data.runner_configuration - ? unmarshalRunnerConfiguration(data.runner_configuration) - : undefined, + runnerConfiguration: data.runner_configuration ? unmarshalRunnerConfiguration(data.runner_configuration) : undefined, sshUsername: data.ssh_username, status: data.status, sudoPassword: data.sudo_password, @@ -151,9 +145,64 @@ export const unmarshalServer = (data: unknown): Server => { } as Server } -export const unmarshalServerPrivateNetwork = ( - data: unknown, -): ServerPrivateNetwork => { +const unmarshalGithubRunnerConfiguration = (data: unknown): GithubRunnerConfiguration => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GithubRunnerConfiguration' failed as data isn't a dictionary.`, + ) + } + + return { + labels: data.labels, + token: data.token, + url: data.url, + } as GithubRunnerConfiguration +} + +const unmarshalGitlabRunnerConfiguration = (data: unknown): GitlabRunnerConfiguration => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GitlabRunnerConfiguration' failed as data isn't a dictionary.`, + ) + } + + return { + token: data.token, + url: data.url, + } as GitlabRunnerConfiguration +} + +const unmarshalRunnerConfigurationV2 = (data: unknown): RunnerConfigurationV2 => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RunnerConfigurationV2' failed as data isn't a dictionary.`, + ) + } + + return { + githubConfiguration: data.github_configuration ? unmarshalGithubRunnerConfiguration(data.github_configuration) : undefined, + gitlabConfiguration: data.gitlab_configuration ? unmarshalGitlabRunnerConfiguration(data.gitlab_configuration) : undefined, + name: data.name, + provider: data.provider, + } as RunnerConfigurationV2 +} + +export const unmarshalRunner = (data: unknown): Runner => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Runner' failed as data isn't a dictionary.`, + ) + } + + return { + configuration: data.configuration ? unmarshalRunnerConfigurationV2(data.configuration) : undefined, + errorMessage: data.error_message, + id: data.id, + status: data.status, + } as Runner +} + +export const unmarshalServerPrivateNetwork = (data: unknown): ServerPrivateNetwork => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`, @@ -268,17 +317,13 @@ export const unmarshalServerType = (data: unknown): ServerType => { memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined, minimumLeaseDuration: data.minimum_lease_duration, name: data.name, - network: data.network - ? unmarshalServerTypeNetwork(data.network) - : undefined, + network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined, stock: data.stock, } as ServerType } -export const unmarshalBatchCreateServersResponse = ( - data: unknown, -): BatchCreateServersResponse => { +export const unmarshalBatchCreateServersResponse = (data: unknown): BatchCreateServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`, @@ -290,9 +335,7 @@ export const unmarshalBatchCreateServersResponse = ( } as BatchCreateServersResponse } -const unmarshalConnectivityDiagnosticServerHealth = ( - data: unknown, -): ConnectivityDiagnosticServerHealth => { +const unmarshalConnectivityDiagnosticServerHealth = (data: unknown): ConnectivityDiagnosticServerHealth => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectivityDiagnosticServerHealth' failed as data isn't a dictionary.`, @@ -309,9 +352,7 @@ const unmarshalConnectivityDiagnosticServerHealth = ( } as ConnectivityDiagnosticServerHealth } -export const unmarshalConnectivityDiagnostic = ( - data: unknown, -): ConnectivityDiagnostic => { +export const unmarshalConnectivityDiagnostic = (data: unknown): ConnectivityDiagnostic => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectivityDiagnostic' failed as data isn't a dictionary.`, @@ -320,9 +361,7 @@ export const unmarshalConnectivityDiagnostic = ( return { errorMessage: data.error_message, - healthDetails: data.health_details - ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) - : undefined, + healthDetails: data.health_details ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) : undefined, id: data.id, isHealthy: data.is_healthy, status: data.status, @@ -343,9 +382,20 @@ export const unmarshalListOSResponse = (data: unknown): ListOSResponse => { } as ListOSResponse } -export const unmarshalListServerPrivateNetworksResponse = ( - data: unknown, -): ListServerPrivateNetworksResponse => { +export const unmarshalListRunnersResponse = (data: unknown): ListRunnersResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRunnersResponse' failed as data isn't a dictionary.`, + ) + } + + return { + runners: unmarshalArrayOfObject(data.runners, unmarshalRunner), + totalCount: data.total_count, + } as ListRunnersResponse +} + +export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -353,17 +403,12 @@ export const unmarshalListServerPrivateNetworksResponse = ( } return { - serverPrivateNetworks: unmarshalArrayOfObject( - data.server_private_networks, - unmarshalServerPrivateNetwork, - ), + serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), totalCount: data.total_count, } as ListServerPrivateNetworksResponse } -export const unmarshalListServerTypesResponse = ( - data: unknown, -): ListServerTypesResponse => { +export const unmarshalListServerTypesResponse = (data: unknown): ListServerTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`, @@ -375,9 +420,7 @@ export const unmarshalListServerTypesResponse = ( } as ListServerTypesResponse } -export const unmarshalListServersResponse = ( - data: unknown, -): ListServersResponse => { +export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -390,9 +433,7 @@ export const unmarshalListServersResponse = ( } as ListServersResponse } -export const unmarshalSetServerPrivateNetworksResponse = ( - data: unknown, -): SetServerPrivateNetworksResponse => { +export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -400,16 +441,11 @@ export const unmarshalSetServerPrivateNetworksResponse = ( } return { - serverPrivateNetworks: unmarshalArrayOfObject( - data.server_private_networks, - unmarshalServerPrivateNetwork, - ), + serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), } as SetServerPrivateNetworksResponse } -export const unmarshalStartConnectivityDiagnosticResponse = ( - data: unknown, -): StartConnectivityDiagnosticResponse => { +export const unmarshalStartConnectivityDiagnosticResponse = (data: unknown): StartConnectivityDiagnosticResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'StartConnectivityDiagnosticResponse' failed as data isn't a dictionary.`, @@ -437,18 +473,60 @@ export const marshalBatchCreateServersRequest = ( os_id: request.osId, project_id: request.projectId ?? defaults.defaultProjectId, public_bandwidth_bps: request.publicBandwidthBps, - requests: - request.requests !== undefined - ? request.requests.map(elt => - marshalBatchCreateServersRequestBatchInnerCreateServerRequest( - elt, - defaults, - ), - ) - : undefined, + requests: ((request.requests !== undefined) ? request.requests.map(elt => marshalBatchCreateServersRequestBatchInnerCreateServerRequest(elt, defaults)): undefined), type: request.type, }) +const marshalGithubRunnerConfiguration = ( + request: GithubRunnerConfiguration, + defaults: DefaultValues, +): Record => ({ + labels: request.labels, + token: request.token, + url: request.url, +}) + +const marshalGitlabRunnerConfiguration = ( + request: GitlabRunnerConfiguration, + defaults: DefaultValues, +): Record => ({ + token: request.token, + url: request.url, +}) + +const marshalRunnerConfigurationV2 = ( + request: RunnerConfigurationV2, + defaults: DefaultValues, +): Record => ({ + name: request.name, + provider: request.provider, + ...resolveOneOf([ + {param: 'github_configuration', + value: (request.githubConfiguration !== undefined) ? marshalGithubRunnerConfiguration(request.githubConfiguration, defaults) + : undefined, + }, + {param: 'gitlab_configuration', + value: (request.gitlabConfiguration !== undefined) ? marshalGitlabRunnerConfiguration(request.gitlabConfiguration, defaults) + : undefined, + }, + ]), +}) + +export const marshalCreateRunnerRequest = ( + request: CreateRunnerRequest, + defaults: DefaultValues, +): Record => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + runner_configuration: marshalRunnerConfigurationV2(request.runnerConfiguration, defaults), +}) + +const marshalAppliedRunnerConfigurations = ( + request: AppliedRunnerConfigurations, + defaults: DefaultValues, +): Record => ({ + runner_configuration_ids: request.runnerConfigurationIds, +}) + const marshalRunnerConfiguration = ( request: RunnerConfiguration, defaults: DefaultValues, @@ -463,16 +541,14 @@ export const marshalCreateServerRequest = ( request: CreateServerRequest, defaults: DefaultValues, ): Record => ({ + applied_runner_configurations: ((request.appliedRunnerConfigurations !== undefined) ? marshalAppliedRunnerConfigurations(request.appliedRunnerConfigurations, defaults): undefined), commitment_type: request.commitmentType, enable_vpc: request.enableVpc, name: request.name || randomName('as'), os_id: request.osId, project_id: request.projectId ?? defaults.defaultProjectId, public_bandwidth_bps: request.publicBandwidthBps, - runner_configuration: - request.runnerConfiguration !== undefined - ? marshalRunnerConfiguration(request.runnerConfiguration, defaults) - : undefined, + runner_configuration: ((request.runnerConfiguration !== undefined) ? marshalRunnerConfiguration(request.runnerConfiguration, defaults): undefined), type: request.type, }) @@ -488,7 +564,7 @@ export const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = ( request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues, ): Record => ({ - per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, + per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, }) export const marshalReinstallServerRequest = ( @@ -505,6 +581,13 @@ export const marshalStartConnectivityDiagnosticRequest = ( server_id: request.serverId, }) +export const marshalUpdateRunnerRequest = ( + request: UpdateRunnerRequest, + defaults: DefaultValues, +): Record => ({ + runner_configuration: marshalRunnerConfigurationV2(request.runnerConfiguration, defaults), +}) + const marshalCommitmentTypeValue = ( request: CommitmentTypeValue, defaults: DefaultValues, @@ -516,10 +599,8 @@ export const marshalUpdateServerRequest = ( request: UpdateServerRequest, defaults: DefaultValues, ): Record => ({ - commitment_type: - request.commitmentType !== undefined - ? marshalCommitmentTypeValue(request.commitmentType, defaults) - : undefined, + applied_runner_configurations: ((request.appliedRunnerConfigurations !== undefined) ? marshalAppliedRunnerConfigurations(request.appliedRunnerConfigurations, defaults): undefined), + commitment_type: ((request.commitmentType !== undefined) ? marshalCommitmentTypeValue(request.commitmentType, defaults): undefined), enable_vpc: request.enableVpc, name: request.name, public_bandwidth_bps: request.publicBandwidthBps, diff --git a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts index be82e2dd3..9a24cbcd2 100644 --- a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts @@ -1,8 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone } from '@scaleway/sdk-client' +import type { Zone as ScwZone} from '@scaleway/sdk-client' -export type CommitmentType = 'duration_24h' | 'renewed_monthly' | 'none' + +export type CommitmentType = + | 'duration_24h' + | 'renewed_monthly' + | 'none' export type ConnectivityDiagnosticActionType = | 'reboot_server' @@ -20,13 +24,27 @@ export type ListServerPrivateNetworksRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' +export type ListServersRequestOrderBy = + | 'created_at_asc' + | 'created_at_desc' export type RunnerConfigurationProvider = | 'unknown_provider' | 'github' | 'gitlab' +export type RunnerConfigurationV2Provider = + | 'unknown_provider' + | 'github' + | 'gitlab' + +export type RunnerStatus = + | 'unknown_status' + | 'waiting' + | 'enabled' + | 'disabled' + | 'error' + export type ServerPrivateNetworkServerStatus = | 'unknown_status' | 'attaching' @@ -65,11 +83,26 @@ export interface OSSupportedServerType { fastDeliveryAvailable: boolean } + +export interface GithubRunnerConfiguration { + url: string + token: string + labels: string[] +} + + +export interface GitlabRunnerConfiguration { + url: string + token: string +} + + export interface Commitment { type: CommitmentType cancelled: boolean } + export interface OS { /** * Unique ID of the OS. @@ -125,6 +158,7 @@ export interface OS { supportedServerTypes: OSSupportedServerType[] } + export interface RunnerConfiguration { name: string url: string @@ -132,6 +166,23 @@ export interface RunnerConfiguration { provider: RunnerConfigurationProvider } + +export interface RunnerConfigurationV2 { + name: string + provider: RunnerConfigurationV2Provider + /** + * + * One-of ('configuration'): at most one of 'githubConfiguration', 'gitlabConfiguration' could be set. + */ + githubConfiguration?: GithubRunnerConfiguration + /** + * + * One-of ('configuration'): at most one of 'githubConfiguration', 'gitlabConfiguration' could be set. + */ + gitlabConfiguration?: GitlabRunnerConfiguration +} + + export interface ServerTypeCPU { name: string coreCount: number @@ -140,34 +191,41 @@ export interface ServerTypeCPU { threadsPerCore: number } + export interface ServerTypeDisk { capacity: number type: string } + export interface ServerTypeGPU { count: number } + export interface ServerTypeMemory { capacity: number type: string } + export interface ServerTypeNPU { count: number } + export interface ServerTypeNetwork { publicBandwidthBps: number supportedBandwidth: number[] defaultPublicBandwidth: number } + export interface BatchCreateServersRequestBatchInnerCreateServerRequest { name: string } + export interface Server { /** * UUID of the server. @@ -254,15 +312,20 @@ export interface Server { */ publicBandwidthBps: number /** - * Current runner configuration, empty if none is installed. + * @deprecated Current runner configuration, empty if none is installed. */ runnerConfiguration?: RunnerConfiguration /** * A list of tags attached to the server. */ tags: string[] + /** + * Runner configurations applied on the server, optional. + */ + appliedRunnerConfigurationIds: string[] } + export interface ConnectivityDiagnosticServerHealth { lastCheckinDate?: Date isServerAlive: boolean @@ -272,6 +335,20 @@ export interface ConnectivityDiagnosticServerHealth { isVncPortUp: boolean } + +export interface AppliedRunnerConfigurations { + runnerConfigurationIds: string[] +} + + +export interface Runner { + id: string + configuration?: RunnerConfigurationV2 + status: RunnerStatus + errorMessage: string +} + + export interface ServerPrivateNetwork { /** * ID of the Server-to-Private Network mapping. @@ -311,6 +388,7 @@ export interface ServerPrivateNetwork { ipamIpIds: string[] } + export interface ServerType { /** * CPU description. @@ -354,10 +432,12 @@ export interface ServerType { npu?: ServerTypeNPU } + export interface CommitmentTypeValue { commitmentType: CommitmentType } + export type BatchCreateServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -393,6 +473,7 @@ export type BatchCreateServersRequest = { requests?: BatchCreateServersRequestBatchInnerCreateServerRequest[] } + export interface BatchCreateServersResponse { /** * List of created servers. @@ -400,6 +481,7 @@ export interface BatchCreateServersResponse { servers: Server[] } + export interface ConnectivityDiagnostic { id: string status: ConnectivityDiagnosticDiagnosticStatus @@ -409,6 +491,23 @@ export interface ConnectivityDiagnostic { errorMessage: string } + +export type CreateRunnerRequest = { + /** + * Zone to target. If none is passed will use default zone from the config. + */ + zone?: ScwZone + /** + * Creates a runner in the given project_id. + */ + projectId?: string + /** + * Configuration details for the runner. + */ + runnerConfiguration: RunnerConfigurationV2 +} + + export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -443,11 +542,28 @@ export type CreateServerRequest = { */ publicBandwidthBps: number /** - * Specify the configuration to install an optional CICD runner on the server during installation. + * @deprecated Specify the configuration to install an optional CICD runner on the server during installation. */ runnerConfiguration?: RunnerConfiguration + /** + * Runner configurations to apply on the server, existing ones missing from the specified configuration will be removed from the server. + */ + appliedRunnerConfigurations?: AppliedRunnerConfigurations } + +export type DeleteRunnerRequest = { + /** + * Zone to target. If none is passed will use default zone from the config. + */ + zone?: ScwZone + /** + * ID of the runner configuration to delete. + */ + runnerId: string +} + + export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -459,6 +575,7 @@ export type DeleteServerRequest = { serverId: string } + export type GetConnectivityDiagnosticRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -467,6 +584,7 @@ export type GetConnectivityDiagnosticRequest = { diagnosticId: string } + export type GetOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -478,6 +596,19 @@ export type GetOSRequest = { osId: string } + +export type GetRunnerRequest = { + /** + * Zone to target. If none is passed will use default zone from the config. + */ + zone?: ScwZone + /** + * ID of the runner configuration to get. + */ + runnerId: string +} + + export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -489,6 +620,7 @@ export type GetServerRequest = { serverId: string } + export type GetServerTypeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -500,6 +632,7 @@ export type GetServerTypeRequest = { serverType: string } + export type ListOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -523,6 +656,7 @@ export type ListOSRequest = { name?: string } + export interface ListOSResponse { /** * Total number of OS. @@ -534,11 +668,47 @@ export interface ListOSResponse { os: OS[] } + +export type ListRunnersRequest = { + /** + * Zone to target. If none is passed will use default zone from the config. + */ + zone?: ScwZone + /** + * ID of the server for which to list applied runner configurations. + */ + serverId?: string + /** + * Only list servers of this project ID. + */ + projectId?: string + /** + * Only list servers of this Organization ID. + */ + organizationId?: string + /** + * Positive integer to choose the page to return. + */ + page?: number + /** + * Positive integer lower or equal to 100 to select the number of items to return. + */ + pageSize?: number +} + + +export interface ListRunnersResponse { + totalCount: number + runners: Runner[] +} + + export interface ListServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] totalCount: number } + export type ListServerTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -546,6 +716,7 @@ export type ListServerTypesRequest = { zone?: ScwZone } + export interface ListServerTypesResponse { /** * Available server types. @@ -553,6 +724,7 @@ export interface ListServerTypesResponse { serverTypes: ServerType[] } + export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -580,6 +752,7 @@ export type ListServersRequest = { pageSize?: number } + export interface ListServersResponse { /** * Total number of servers. @@ -591,6 +764,7 @@ export interface ListServersResponse { servers: Server[] } + export type PrivateNetworkApiAddServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -610,6 +784,7 @@ export type PrivateNetworkApiAddServerPrivateNetworkRequest = { ipamIpIds?: string[] } + export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -625,6 +800,7 @@ export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { privateNetworkId: string } + export type PrivateNetworkApiGetServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -634,6 +810,7 @@ export type PrivateNetworkApiGetServerPrivateNetworkRequest = { privateNetworkId: string } + export type PrivateNetworkApiListServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -673,6 +850,7 @@ export type PrivateNetworkApiListServerPrivateNetworksRequest = { ipamIpIds?: string[] } + export type PrivateNetworkApiSetServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -688,6 +866,7 @@ export type PrivateNetworkApiSetServerPrivateNetworksRequest = { perPrivateNetworkIpamIpIds: Record } + export type RebootServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -699,6 +878,7 @@ export type RebootServerRequest = { serverId: string } + export type ReinstallServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -714,10 +894,12 @@ export type ReinstallServerRequest = { osId?: string } + export interface SetServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] } + export type StartConnectivityDiagnosticRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -726,10 +908,28 @@ export type StartConnectivityDiagnosticRequest = { serverId: string } + export interface StartConnectivityDiagnosticResponse { diagnosticId: string } + +export type UpdateRunnerRequest = { + /** + * Zone to target. If none is passed will use default zone from the config. + */ + zone?: ScwZone + /** + * ID of the runner configuration to update. + */ + runnerId: string + /** + * Configuration details for the runner. + */ + runnerConfiguration: RunnerConfigurationV2 +} + + export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -759,4 +959,10 @@ export type UpdateServerRequest = { * Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint. */ publicBandwidthBps?: number + /** + * Runner configurations to apply on the server, existing ones missing from the specified configuration will be removed from the server. + */ + appliedRunnerConfigurations?: AppliedRunnerConfigurations } + + diff --git a/packages_generated/applesilicon/src/v1alpha1/validation-rules.gen.ts b/packages_generated/applesilicon/src/v1alpha1/validation-rules.gen.ts new file mode 100644 index 000000000..f88e64520 --- /dev/null +++ b/packages_generated/applesilicon/src/v1alpha1/validation-rules.gen.ts @@ -0,0 +1,9 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. + +export const RunnerConfigurationV2 = { + name: { + maxLength: 255, + minLength: 1, + }, +}