Skip to content
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
46 changes: 46 additions & 0 deletions packages/clients/src/api/baremetal/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
marshalUpdateIPRequest,
marshalUpdateServerRequest,
marshalUpdateSettingRequest,
marshalValidatePartitioningSchemaRequest,
unmarshalBMCAccess,
unmarshalGetServerMetricsResponse,
unmarshalIP,
Expand All @@ -34,6 +35,7 @@ import {
unmarshalOS,
unmarshalOffer,
unmarshalOption,
unmarshalSchema,
unmarshalServer,
unmarshalServerPrivateNetwork,
unmarshalSetServerPrivateNetworksResponse,
Expand All @@ -46,6 +48,7 @@ import type {
DeleteOptionServerRequest,
DeleteServerRequest,
GetBMCAccessRequest,
GetDefaultPartitioningSchemaRequest,
GetOSRequest,
GetOfferRequest,
GetOptionRequest,
Expand Down Expand Up @@ -75,6 +78,7 @@ import type {
PrivateNetworkApiListServerPrivateNetworksRequest,
PrivateNetworkApiSetServerPrivateNetworksRequest,
RebootServerRequest,
Schema,
Server,
ServerPrivateNetwork,
SetServerPrivateNetworksResponse,
Expand All @@ -86,6 +90,7 @@ import type {
UpdateIPRequest,
UpdateServerRequest,
UpdateSettingRequest,
ValidatePartitioningSchemaRequest,
} from './types.gen'

const jsonContentHeaders = {
Expand Down Expand Up @@ -357,6 +362,47 @@ export class API extends ParentAPI {
listServerEvents = (request: Readonly<ListServerEventsRequest>) =>
enrichForPagination('events', this.pageOfListServerEvents, request)

/**
* Get default partitioning schema. Get the default partitioning schema for
* the given offer ID and OS ID.
*
* @param request - The request {@link GetDefaultPartitioningSchemaRequest}
* @returns A Promise of Schema
*/
getDefaultPartitioningSchema = (
request: Readonly<GetDefaultPartitioningSchemaRequest>,
) =>
this.client.fetch<Schema>(
{
method: 'GET',
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
urlParams: urlParams(
['offer_id', request.offerId],
['os_id', request.osId],
),
},
unmarshalSchema,
)

/**
* Validate client partitioning schema. Validate the incoming partitioning
* schema from a user before installing the server. Return default ErrorCode
* if invalid.
*
* @param request - The request {@link ValidatePartitioningSchemaRequest}
*/
validatePartitioningSchema = (
request: Readonly<ValidatePartitioningSchemaRequest>,
) =>
this.client.fetch<void>({
body: JSON.stringify(
marshalValidatePartitioningSchemaRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`,
})

/**
* Start BMC access. Start BMC (Baseboard Management Controller) access
* associated with the ID. The BMC (Baseboard Management Controller) access is
Expand Down
17 changes: 17 additions & 0 deletions packages/clients/src/api/baremetal/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type {
DeleteServerRequest,
Disk,
GetBMCAccessRequest,
GetDefaultPartitioningSchemaRequest,
GetOSRequest,
GetOfferRequest,
GetOptionRequest,
Expand Down Expand Up @@ -59,6 +60,21 @@ export type {
RaidController,
RebootServerRequest,
RemoteAccessOption,
Schema,
SchemaDisk,
SchemaFilesystem,
SchemaFilesystemFormat,
SchemaLVM,
SchemaLogicalVolume,
SchemaLogicalVolumeType,
SchemaPartition,
SchemaPartitionLabel,
SchemaPool,
SchemaPoolType,
SchemaRAID,
SchemaRAIDLevel,
SchemaVolumeGroup,
SchemaZFS,
Server,
ServerBootType,
ServerEvent,
Expand All @@ -81,5 +97,6 @@ export type {
UpdateIPRequest,
UpdateServerRequest,
UpdateSettingRequest,
ValidatePartitioningSchemaRequest,
} from './types.gen'
export * as ValidationRules from './validation-rules.gen'
Loading