Skip to content

Commit ca5e001

Browse files
authored
feat: Changes to Instance for day2 in API (#173)
1 parent 9ac302e commit ca5e001

File tree

8 files changed

+674
-598
lines changed

8 files changed

+674
-598
lines changed

apiv2/api/openapi/openapi.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4980,12 +4980,12 @@ components:
49804980
$ref: '#/components/schemas/OperatingSystemResource'
49814981
desiredOs:
49824982
title: desired_os
4983-
description: OS resource that should be installed to this Instance.
4983+
description: Deprecated, will be removed in EMF v3.2.0, use OSUpdatePolicy for driving day2, and os for day0 operations instead. OS resource that should be installed to this Instance.
49844984
readOnly: true
49854985
$ref: '#/components/schemas/OperatingSystemResource'
49864986
currentOs:
49874987
title: current_os
4988-
description: OS resource that is currently installed for this Instance.
4988+
description: Deprecated, will be removed in EMF v3.2.0, use os field instead. OS resource that is currently installed for this Instance.
49894989
readOnly: true
49904990
$ref: '#/components/schemas/OperatingSystemResource'
49914991
securityFeature:
@@ -5044,7 +5044,7 @@ components:
50445044
type: string
50455045
title: update_status_detail
50465046
maxLength: 100000
5047-
description: JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change.
5047+
description: Deprecated, will be removed in EMF v3.2.0, use OSUpdateRun instead. JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change.
50485048
readOnly: true
50495049
trustedAttestationStatus:
50505050
type: string
@@ -5093,6 +5093,20 @@ components:
50935093
pattern: ^$|^[a-zA-Z-_0-9./:;=@?!#,<>*+~()"\ \n{}[]]+$
50945094
description: The CVEs that are currently present on the Instance, encoded as a JSON list.
50955095
readOnly: true
5096+
runtimePackages:
5097+
type: string
5098+
title: runtime_packages
5099+
maxLength: 500000
5100+
pattern: ^$|^[a-zA-Z-_0-9./:;=@?!#,<>*+~()"\ \n{}[]]+$
5101+
description: The packages available on the Instance at runtime, represented as a JSON list.
5102+
readOnly: true
5103+
osUpdateAvailable:
5104+
type: string
5105+
title: os_update_available
5106+
maxLength: 10000
5107+
pattern: ^$|^[a-zA-Z-_0-9./:;=?@!#,<>*()"\ \n]+$
5108+
description: Details about OS Updates available for this Instance. If empty, there are no updates available.
5109+
readOnly: true
50965110
instanceID:
50975111
type: string
50985112
title: instanceID
@@ -5112,7 +5126,7 @@ components:
51125126
title: osID
51135127
maxLength: 11
51145128
pattern: ^os-[0-9a-f]{8}$
5115-
description: The unique identifier of OS resource that must be installed on the instance.
5129+
description: The unique identifier of OS resource that must be installed on the instance. The field is used to drive the day0 operations, and immutable once set the first time.
51165130
writeOnly: true
51175131
localAccountID:
51185132
type: string

apiv2/api/proto/resources/compute/v1/compute.proto

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ message InstanceResource {
349349
HostResource host = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
350350
// OS resource that should be installed to this Instance.
351351
resources.os.v1.OperatingSystemResource os = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
352-
// OS resource that should be installed to this Instance.
352+
// Deprecated, will be removed in EMF v3.2.0, use OSUpdatePolicy for driving day2, and os for day0 operations instead. OS resource that should be installed to this Instance.
353353
resources.os.v1.OperatingSystemResource desired_os = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
354-
// OS resource that is currently installed for this Instance.
354+
// Deprecated, will be removed in EMF v3.2.0, use os field instead. OS resource that is currently installed for this Instance.
355355
resources.os.v1.OperatingSystemResource current_os = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
356356
// Select to enable security features such as Secure Boot (SB) and Full Disk Encryption (FDE).
357357
resources.os.v1.SecurityFeature security_feature = 14;
@@ -382,7 +382,7 @@ message InstanceResource {
382382
status.v1.StatusIndication update_status_indicator = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
383383
// UTC timestamp when update_status was last changed. Set by RMs only.
384384
uint32 update_status_timestamp = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
385-
// JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change.
385+
// Deprecated, will be removed in EMF v3.2.0, use OSUpdateRun instead. JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change.
386386
string update_status_detail = 24 [(buf.validate.field).string = {max_len: 100000},
387387
(google.api.field_behavior) = OUTPUT_ONLY
388388
];
@@ -413,7 +413,7 @@ message InstanceResource {
413413
pattern: '^$|^[a-zA-Z-_0-9./:;=?@!#,<>*() ]+$'
414414
},
415415
(buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
416-
];
416+
];
417417

418418
// The CVEs that are currently present on the Instance, encoded as a JSON list.
419419
string existing_cves = 42 [
@@ -424,6 +424,24 @@ message InstanceResource {
424424
}
425425
];
426426

427+
// The packages available on the Instance at runtime, represented as a JSON list.
428+
string runtime_packages = 51 [
429+
(google.api.field_behavior) = OUTPUT_ONLY,
430+
(buf.validate.field).string = {
431+
pattern: "^$|^[a-zA-Z-_0-9./:;=@?!#,<>*+~()\"\\ \\n{}[]]+$"
432+
max_len: 500000
433+
}
434+
];
435+
436+
// Details about OS Updates available for this Instance. If empty, there are no updates available.
437+
string os_update_available = 52 [
438+
(google.api.field_behavior) = OUTPUT_ONLY,
439+
(buf.validate.field).string = {
440+
pattern: '^$|^[a-zA-Z-_0-9./:;=?@!#,<>*()\"\\ \\n]+$'
441+
max_len: 10000
442+
}
443+
];
444+
427445
// Deprecated, The instance's unique identifier. Alias of resourceID.
428446
string instanceID = 5001 [
429447
(google.api.field_behavior) = OUTPUT_ONLY,
@@ -442,7 +460,7 @@ message InstanceResource {
442460
}
443461
];
444462

445-
// The unique identifier of OS resource that must be installed on the instance.
463+
// The unique identifier of OS resource that must be installed on the instance. The field is used to drive the day0 operations, and immutable once set the first time.
446464
string osID = 5003 [
447465
(google.api.field_behavior) = INPUT_ONLY,
448466
(buf.validate.field).string = {

apiv2/docs/proto.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,8 @@ host or hypervisor.
862862
| current_state | [InstanceState](#resources-compute-v1-InstanceState) | | The Instance current state. |
863863
| host | [HostResource](#resources-compute-v1-HostResource) | | Host this Instance is placed on. Only applicable to baremetal instances. |
864864
| os | [resources.os.v1.OperatingSystemResource](#resources-os-v1-OperatingSystemResource) | | OS resource that should be installed to this Instance. |
865-
| desired_os | [resources.os.v1.OperatingSystemResource](#resources-os-v1-OperatingSystemResource) | | OS resource that should be installed to this Instance. |
866-
| current_os | [resources.os.v1.OperatingSystemResource](#resources-os-v1-OperatingSystemResource) | | OS resource that is currently installed for this Instance. |
865+
| desired_os | [resources.os.v1.OperatingSystemResource](#resources-os-v1-OperatingSystemResource) | | Deprecated, will be removed in EMF v3.2.0, use OSUpdatePolicy for driving day2, and os for day0 operations instead. OS resource that should be installed to this Instance. |
866+
| current_os | [resources.os.v1.OperatingSystemResource](#resources-os-v1-OperatingSystemResource) | | Deprecated, will be removed in EMF v3.2.0, use os field instead. OS resource that is currently installed for this Instance. |
867867
| security_feature | [resources.os.v1.SecurityFeature](#resources-os-v1-SecurityFeature) | | Select to enable security features such as Secure Boot (SB) and Full Disk Encryption (FDE). |
868868
| instance_status | [string](#string) | | textual message that describes the current instance status. Set by RMs only. |
869869
| instance_status_indicator | [resources.status.v1.StatusIndication](#resources-status-v1-StatusIndication) | | Indicates interpretation of instance_status. Set by RMs only. |
@@ -874,7 +874,7 @@ host or hypervisor.
874874
| update_status | [string](#string) | | textual message that describes the update status of Instance. Set by RMs only. |
875875
| update_status_indicator | [resources.status.v1.StatusIndication](#resources-status-v1-StatusIndication) | | Indicates interpretation of update_status. Set by RMs only. |
876876
| update_status_timestamp | [uint32](#uint32) | | UTC timestamp when update_status was last changed. Set by RMs only. |
877-
| update_status_detail | [string](#string) | | JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change. |
877+
| update_status_detail | [string](#string) | | Deprecated, will be removed in EMF v3.2.0, use OSUpdateRun instead. JSON field storing details of Instance update status. Set by RMs only. Beta, subject to change. |
878878
| trusted_attestation_status | [string](#string) | | textual message that describes the trusted_attestation status of Instance. Set by RMs only. |
879879
| trusted_attestation_status_indicator | [resources.status.v1.StatusIndication](#resources-status-v1-StatusIndication) | | Indicates interpretation of trusted_attestation_status. Set by RMs only. |
880880
| trusted_attestation_status_timestamp | [uint32](#uint32) | | UTC timestamp when trusted_attestation_status was last changed. Set by RMs only. |
@@ -885,9 +885,11 @@ back-reference to the Workload Members associated to this Instance |
885885
| update_policy | [OSUpdatePolicy](#resources-compute-v1-OSUpdatePolicy) | | Update Policy of this Instance |
886886
| instance_status_detail | [string](#string) | | Textual message that gives detailed status of the instance&#39;s software components. |
887887
| existing_cves | [string](#string) | | The CVEs that are currently present on the Instance, encoded as a JSON list. |
888+
| runtime_packages | [string](#string) | | The packages available on the Instance at runtime, represented as a JSON list. |
889+
| os_update_available | [string](#string) | | Details about OS Updates available for this Instance. If empty, there are no updates available. |
888890
| instanceID | [string](#string) | | Deprecated, The instance&#39;s unique identifier. Alias of resourceID. |
889891
| hostID | [string](#string) | | The host&#39;s unique identifier associated with the instance. |
890-
| osID | [string](#string) | | The unique identifier of OS resource that must be installed on the instance. |
892+
| osID | [string](#string) | | The unique identifier of OS resource that must be installed on the instance. The field is used to drive the day0 operations, and immutable once set the first time. |
891893
| local_accountID | [string](#string) | | The unique identifier of local account will be associated with the instance. |
892894
| os_update_policyID | [string](#string) | | |
893895
| timestamps | [resources.common.v1.Timestamps](#resources-common-v1-Timestamps) | | Timestamps associated to the resource. |

0 commit comments

Comments
 (0)