Skip to content

Commit c71cda1

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
style(oci-compute): align remaining schema and output declarations
1 parent 3e33857 commit c71cda1

7 files changed

Lines changed: 620 additions & 176 deletions

File tree

apps/sim/blocks/blocks/oci_compute.ts

Lines changed: 90 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
811811
condition: { field: 'operation', value: SHAPE_OPERATIONS },
812812
required: {
813813
field: 'operation',
814-
value: [
815-
'oci_compute_launch_instance',
816-
'oci_compute_get_image_shape_compatibility_entry',
817-
],
814+
value: ['oci_compute_launch_instance', 'oci_compute_get_image_shape_compatibility_entry'],
818815
},
819816
},
820817
{
@@ -828,10 +825,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
828825
condition: { field: 'operation', value: SHAPE_OPERATIONS },
829826
required: {
830827
field: 'operation',
831-
value: [
832-
'oci_compute_launch_instance',
833-
'oci_compute_get_image_shape_compatibility_entry',
834-
],
828+
value: ['oci_compute_launch_instance', 'oci_compute_get_image_shape_compatibility_entry'],
835829
},
836830
},
837831
{
@@ -1202,10 +1196,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
12021196
condition: { field: 'operation', value: ACTION_OPERATIONS },
12031197
required: {
12041198
field: 'operation',
1205-
value: [
1206-
'oci_compute_instance_action',
1207-
'oci_compute_instance_pool_action',
1208-
],
1199+
value: ['oci_compute_instance_action', 'oci_compute_instance_pool_action'],
12091200
},
12101201
},
12111202
{
@@ -1388,7 +1379,11 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
13881379
placeholder:
13891380
'Typed compute configuration with instanceType "compute". Optional launchDetails fields: compartmentId, availabilityDomain, displayName, shape, shapeConfig (ocpus or vcpus, memoryInGBs, nvmes up to 6, baselineOcpuUtilization), faultDomain, createVnicDetails, sourceDetails, metadata, extendedMetadata, freeformTags, definedTags, agentConfig, availabilityConfig, instanceOptions, capacityReservationId, dedicatedVmHostId. sourceDetails uses sourceType "image" with imageId or instanceSourceImageFilterDetails and bootVolumeSizeInGBs/bootVolumeVpusPerGB/kmsKeyId, or "bootVolume" with bootVolumeId. Optional blockVolumes entries accept volumeId and attachDetails (type "iscsi" with useChap, or "paravirtualized" with isPvEncryptionInTransitEnabled; both support displayName, device, isReadOnly, isShareable). Optional secondaryVnics entries accept displayName, nicIndex, createVnicDetails. Omit deferred template fields; launch overrides supply missing values. No volume creation or unknown fields',
13901381
condition: { field: 'operation', value: INSTANCE_DETAILS_OPERATIONS },
1391-
required: { field: 'operation', value: 'oci_compute_create_instance_configuration', and: { field: 'configurationSource', value: 'NONE' } },
1382+
required: {
1383+
field: 'operation',
1384+
value: 'oci_compute_create_instance_configuration',
1385+
and: { field: 'configurationSource', value: 'NONE' },
1386+
},
13921387
},
13931388
{
13941389
id: 'instancePoolIdSelector',
@@ -1477,8 +1472,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
14771472
id: 'instanceHostnameFormatter',
14781473
title: 'Instance Hostname Formatter',
14791474
type: 'short-input',
1480-
placeholder:
1481-
'Hostname formatter for future pool instances; empty string clears it on update',
1475+
placeholder: 'Hostname formatter for future pool instances; empty string clears it on update',
14821476
mode: 'advanced',
14831477
condition: { field: 'operation', value: INSTANCE_HOSTNAME_FORMATTER_OPERATIONS },
14841478
required: false,
@@ -1574,10 +1568,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
15741568
condition: { field: 'operation', value: SUBNET_ID_OPERATIONS },
15751569
required: {
15761570
field: 'operation',
1577-
value: [
1578-
'oci_compute_get_subnet',
1579-
'oci_compute_launch_instance',
1580-
],
1571+
value: ['oci_compute_get_subnet', 'oci_compute_launch_instance'],
15811572
},
15821573
},
15831574
{
@@ -1590,10 +1581,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
15901581
condition: { field: 'operation', value: SUBNET_ID_OPERATIONS },
15911582
required: {
15921583
field: 'operation',
1593-
value: [
1594-
'oci_compute_get_subnet',
1595-
'oci_compute_launch_instance',
1596-
],
1584+
value: ['oci_compute_get_subnet', 'oci_compute_launch_instance'],
15971585
},
15981586
},
15991587
{
@@ -1714,35 +1702,91 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
17141702
else delete result[field]
17151703
}
17161704
if (params.operation === 'oci_compute_create_instance_pool') {
1717-
if (result.instanceDisplayNameFormatter === '') result.instanceDisplayNameFormatter = undefined
1705+
if (result.instanceDisplayNameFormatter === '')
1706+
result.instanceDisplayNameFormatter = undefined
17181707
if (result.instanceHostnameFormatter === '') result.instanceHostnameFormatter = undefined
17191708
}
1720-
if (params.operation === 'oci_compute_list_instances' && result.capacityReservationId === '') {
1709+
if (
1710+
params.operation === 'oci_compute_list_instances' &&
1711+
result.capacityReservationId === ''
1712+
) {
17211713
result.capacityReservationId = undefined
17221714
}
1723-
for (const field of ['compartmentId', 'page', 'sortBy', 'sortOrder', 'displayName', 'availabilityDomain', 'lifecycleState', 'instanceId', 'shape', 'sourceMode', 'imageId', 'imageFilter', 'bootVolumeId', 'kmsKeyId', 'freeformTags', 'definedTags', 'retryToken', 'shapeConfig', 'createVnicDetails', 'faultDomain', 'metadata', 'extendedMetadata', 'agentConfig', 'availabilityConfig', 'instanceOptions', 'dedicatedVmHostId', 'ifMatch', 'timeMaintenanceRebootDue', 'updateOperationConstraint', 'action', 'timeScheduled', 'operatingSystem', 'operatingSystemVersion', 'shapeAvailabilities', 'instanceConfigurationId', 'configurationSource', 'instanceDetails', 'instancePoolId', 'placementConfigurations', 'name', 'accessLevel', 'vcnId', 'subnetId', 'vnicId', 'resourceId', 'workRequestId']) {
1715+
for (const field of [
1716+
'compartmentId',
1717+
'page',
1718+
'sortBy',
1719+
'sortOrder',
1720+
'displayName',
1721+
'availabilityDomain',
1722+
'lifecycleState',
1723+
'instanceId',
1724+
'shape',
1725+
'sourceMode',
1726+
'imageId',
1727+
'imageFilter',
1728+
'bootVolumeId',
1729+
'kmsKeyId',
1730+
'freeformTags',
1731+
'definedTags',
1732+
'retryToken',
1733+
'shapeConfig',
1734+
'createVnicDetails',
1735+
'faultDomain',
1736+
'metadata',
1737+
'extendedMetadata',
1738+
'agentConfig',
1739+
'availabilityConfig',
1740+
'instanceOptions',
1741+
'dedicatedVmHostId',
1742+
'ifMatch',
1743+
'timeMaintenanceRebootDue',
1744+
'updateOperationConstraint',
1745+
'action',
1746+
'timeScheduled',
1747+
'operatingSystem',
1748+
'operatingSystemVersion',
1749+
'shapeAvailabilities',
1750+
'instanceConfigurationId',
1751+
'configurationSource',
1752+
'instanceDetails',
1753+
'instancePoolId',
1754+
'placementConfigurations',
1755+
'name',
1756+
'accessLevel',
1757+
'vcnId',
1758+
'subnetId',
1759+
'vnicId',
1760+
'resourceId',
1761+
'workRequestId',
1762+
]) {
17241763
if (result[field] === '') delete result[field]
17251764
}
17261765
if (params.operation === 'oci_compute_launch_instance') {
17271766
let vnic = result.createVnicDetails
17281767
if (typeof vnic === 'string') vnic = JSON.parse(vnic)
1729-
if (vnic !== undefined && (vnic === null || typeof vnic !== 'object' || Array.isArray(vnic))) {
1768+
if (
1769+
vnic !== undefined &&
1770+
(vnic === null || typeof vnic !== 'object' || Array.isArray(vnic))
1771+
) {
17301772
throw new Error('Primary VNIC settings must be a JSON object')
17311773
}
17321774
result.createVnicDetails = { ...(vnic ?? {}), subnetId: params.subnetId }
17331775
if (params.sourceMode !== 'image') result.imageId = undefined
17341776
if (params.sourceMode !== 'imageFilter') result.imageFilter = undefined
17351777
if (params.sourceMode !== 'bootVolume') result.bootVolumeId = undefined
17361778
if (params.sourceMode === 'bootVolume') {
1737-
for (const field of ['bootVolumeSizeInGBs', 'bootVolumeVpusPerGB', 'kmsKeyId']) delete result[field]
1779+
for (const field of ['bootVolumeSizeInGBs', 'bootVolumeVpusPerGB', 'kmsKeyId'])
1780+
delete result[field]
17381781
}
17391782
}
17401783
if (params.operation === 'oci_compute_create_instance_configuration') {
17411784
if (params.configurationSource === 'INSTANCE') result.instanceDetails = undefined
17421785
else result.instanceId = undefined
17431786
}
17441787
if (params.operation === 'oci_compute_instance_action') {
1745-
if (params.action !== 'RESET' && params.action !== 'SOFTRESET') result.allowDenseRebootMigration = undefined
1788+
if (params.action !== 'RESET' && params.action !== 'SOFTRESET')
1789+
result.allowDenseRebootMigration = undefined
17461790
if (params.action !== 'REBOOTMIGRATE') {
17471791
result.deleteLocalStorage = undefined
17481792
result.timeScheduled = undefined
@@ -1756,8 +1800,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
17561800
parentCompartmentId: { type: 'string', description: 'Parent for compartment discovery' },
17571801
resourceCompartmentId: {
17581802
type: 'string',
1759-
description:
1760-
'Source compartment for resource discovery',
1803+
description: 'Source compartment for resource discovery',
17611804
},
17621805
oauthCredential: { type: 'string', description: 'Authorized OCI credential ID' },
17631806
region: { type: 'string', description: 'OCI region' },
@@ -1776,18 +1819,15 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
17761819
sortOrder: { type: 'string', description: 'Sort direction: ASC or DESC' },
17771820
displayName: {
17781821
type: 'string',
1779-
description:
1780-
'Display name; on list operations this is an exact provider filter',
1822+
description: 'Display name; on list operations this is an exact provider filter',
17811823
},
17821824
availabilityDomain: {
17831825
type: 'string',
1784-
description:
1785-
'Exact availability-domain name returned by OCI discovery',
1826+
description: 'Exact availability-domain name returned by OCI discovery',
17861827
},
17871828
lifecycleState: {
17881829
type: 'string',
1789-
description:
1790-
'Exact lifecycle-state filter supported by this resource',
1830+
description: 'Exact lifecycle-state filter supported by this resource',
17911831
},
17921832
capacityReservationId: {
17931833
type: 'string',
@@ -1818,8 +1858,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
18181858
},
18191859
bootVolumeSizeInGBs: {
18201860
type: 'number',
1821-
description:
1822-
'Image-source boot volume size in GB, 50–32768; increases storage charges',
1861+
description: 'Image-source boot volume size in GB, 50–32768; increases storage charges',
18231862
},
18241863
bootVolumeVpusPerGB: {
18251864
type: 'number',
@@ -1828,13 +1867,11 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
18281867
},
18291868
kmsKeyId: {
18301869
type: 'string',
1831-
description:
1832-
'Existing Vault key OCID for a newly created image-source boot volume',
1870+
description: 'Existing Vault key OCID for a newly created image-source boot volume',
18331871
},
18341872
freeformTags: {
18351873
type: 'json',
1836-
description:
1837-
'Free-form tags as a string-to-string JSON map',
1874+
description: 'Free-form tags as a string-to-string JSON map',
18381875
},
18391876
definedTags: {
18401877
type: 'json',
@@ -1858,8 +1895,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
18581895
},
18591896
faultDomain: {
18601897
type: 'string',
1861-
description:
1862-
'Fault domain within the selected availability domain',
1898+
description: 'Fault domain within the selected availability domain',
18631899
},
18641900
metadata: {
18651901
type: 'json',
@@ -1883,8 +1919,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
18831919
},
18841920
instanceOptions: {
18851921
type: 'json',
1886-
description:
1887-
'Instance options: areLegacyImdsEndpointsDisabled',
1922+
description: 'Instance options: areLegacyImdsEndpointsDisabled',
18881923
},
18891924
dedicatedVmHostId: {
18901925
type: 'string',
@@ -1923,8 +1958,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
19231958
},
19241959
timeScheduled: {
19251960
type: 'string',
1926-
description:
1927-
'RFC3339 REBOOTMIGRATE timestamp; omit for immediate migration',
1961+
description: 'RFC3339 REBOOTMIGRATE timestamp; omit for immediate migration',
19281962
},
19291963
preserveBootVolume: {
19301964
type: 'boolean',
@@ -1939,8 +1973,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
19391973
operatingSystem: { type: 'string', description: 'Exact image operating-system filter' },
19401974
operatingSystemVersion: {
19411975
type: 'string',
1942-
description:
1943-
'Exact image operating-system-version filter',
1976+
description: 'Exact image operating-system-version filter',
19441977
},
19451978
shapeAvailabilities: {
19461979
type: 'json',
@@ -1981,8 +2014,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
19812014
},
19822015
isAutoTerminate: {
19832016
type: 'boolean',
1984-
description:
1985-
'Terminate the detached instance (default false)',
2017+
description: 'Terminate the detached instance (default false)',
19862018
},
19872019
isDecrementSize: {
19882020
type: 'boolean',
@@ -2005,13 +2037,11 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
20052037
vnicId: { type: 'string', description: 'VNIC OCID' },
20062038
resourceId: {
20072039
type: 'string',
2008-
description:
2009-
'Filter work requests by affected resource OCID',
2040+
description: 'Filter work requests by affected resource OCID',
20102041
},
20112042
workRequestId: {
20122043
type: 'string',
2013-
description:
2014-
'Work request OCID returned by a supported asynchronous operation',
2044+
description: 'Work request OCID returned by a supported asynchronous operation',
20152045
},
20162046
},
20172047
outputs: {
@@ -2050,13 +2080,11 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
20502080
},
20512081
compatibilityEntries: {
20522082
type: 'json',
2053-
description:
2054-
'OCI fields: imageId, shape, memoryConstraints, ocpuConstraints',
2083+
description: 'OCI fields: imageId, shape, memoryConstraints, ocpuConstraints',
20552084
},
20562085
compatibilityEntry: {
20572086
type: 'json',
2058-
description:
2059-
'OCI fields: imageId, shape, memoryConstraints, ocpuConstraints',
2087+
description: 'OCI fields: imageId, shape, memoryConstraints, ocpuConstraints',
20602088
},
20612089
capacityReport: {
20622090
type: 'json',
@@ -2096,8 +2124,7 @@ export const OciComputeBlock: BlockConfig<OciComputeResponse> = {
20962124
availabilityDomains: { type: 'json', description: 'OCI fields: id, compartmentId, name' },
20972125
faultDomains: {
20982126
type: 'json',
2099-
description:
2100-
'OCI fields: id, compartmentId, name, availabilityDomain',
2127+
description: 'OCI fields: id, compartmentId, name, availabilityDomain',
21012128
},
21022129
compartments: {
21032130
type: 'json',

0 commit comments

Comments
 (0)