1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.osconfig.v1alpha; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/resource.proto"; 22import "google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto"; 23import "google/cloud/osconfig/v1alpha/inventory.proto"; 24import "google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto"; 25import "google/cloud/osconfig/v1alpha/os_policy_assignments.proto"; 26import "google/cloud/osconfig/v1alpha/vulnerability.proto"; 27import "google/longrunning/operations.proto"; 28 29option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha"; 30option go_package = "cloud.google.com/go/osconfig/apiv1alpha/osconfigpb;osconfigpb"; 31option java_multiple_files = true; 32option java_outer_classname = "OsConfigZonalServiceProto"; 33option java_package = "com.google.cloud.osconfig.v1alpha"; 34option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha"; 35option ruby_package = "Google::Cloud::OsConfig::V1alpha"; 36option (google.api.resource_definition) = { 37 type: "compute.googleapis.com/Instance" 38 pattern: "projects/{project}/locations/{location}/instances/{instance}" 39}; 40 41// Zonal OS Config API 42// 43// The OS Config service is the server-side component that allows users to 44// manage package installations and patch jobs for Compute Engine VM instances. 45service OsConfigZonalService { 46 option (google.api.default_host) = "osconfig.googleapis.com"; 47 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; 48 49 // Create an OS policy assignment. 50 // 51 // This method also creates the first revision of the OS policy assignment. 52 // 53 // This method returns a long running operation (LRO) that contains the 54 // rollout details. The rollout can be cancelled by cancelling the LRO. 55 // 56 // For more information, see [Method: 57 // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). 58 rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { 59 option (google.api.http) = { 60 post: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments" 61 body: "os_policy_assignment" 62 }; 63 option (google.api.method_signature) = "parent,os_policy_assignment,os_policy_assignment_id"; 64 option (google.longrunning.operation_info) = { 65 response_type: "OSPolicyAssignment" 66 metadata_type: "OSPolicyAssignmentOperationMetadata" 67 }; 68 } 69 70 // Update an existing OS policy assignment. 71 // 72 // This method creates a new revision of the OS policy assignment. 73 // 74 // This method returns a long running operation (LRO) that contains the 75 // rollout details. The rollout can be cancelled by cancelling the LRO. 76 // 77 // For more information, see [Method: 78 // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). 79 rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { 80 option (google.api.http) = { 81 patch: "/v1alpha/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" 82 body: "os_policy_assignment" 83 }; 84 option (google.api.method_signature) = "os_policy_assignment,update_mask"; 85 option (google.longrunning.operation_info) = { 86 response_type: "OSPolicyAssignment" 87 metadata_type: "OSPolicyAssignmentOperationMetadata" 88 }; 89 } 90 91 // Retrieve an existing OS policy assignment. 92 // 93 // This method always returns the latest revision. In order to retrieve a 94 // previous revision of the assignment, also provide the revision ID in the 95 // `name` parameter. 96 rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) returns (OSPolicyAssignment) { 97 option (google.api.http) = { 98 get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" 99 }; 100 option (google.api.method_signature) = "name"; 101 } 102 103 // List the OS policy assignments under the parent resource. 104 // 105 // For each OS policy assignment, the latest revision is returned. 106 rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) returns (ListOSPolicyAssignmentsResponse) { 107 option (google.api.http) = { 108 get: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments" 109 }; 110 option (google.api.method_signature) = "parent"; 111 } 112 113 // List the OS policy assignment revisions for a given OS policy assignment. 114 rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) returns (ListOSPolicyAssignmentRevisionsResponse) { 115 option (google.api.http) = { 116 get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" 117 }; 118 option (google.api.method_signature) = "name"; 119 } 120 121 // Delete the OS policy assignment. 122 // 123 // This method creates a new revision of the OS policy assignment. 124 // 125 // This method returns a long running operation (LRO) that contains the 126 // rollout details. The rollout can be cancelled by cancelling the LRO. 127 // 128 // If the LRO completes and is not cancelled, all revisions associated with 129 // the OS policy assignment are deleted. 130 // 131 // For more information, see [Method: 132 // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel). 133 rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) returns (google.longrunning.Operation) { 134 option (google.api.http) = { 135 delete: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}" 136 }; 137 option (google.api.method_signature) = "name"; 138 option (google.longrunning.operation_info) = { 139 response_type: "google.protobuf.Empty" 140 metadata_type: "OSPolicyAssignmentOperationMetadata" 141 }; 142 } 143 144 // Get OS policies compliance data for the specified Compute Engine VM 145 // instance. 146 rpc GetInstanceOSPoliciesCompliance(GetInstanceOSPoliciesComplianceRequest) returns (InstanceOSPoliciesCompliance) { 147 option deprecated = true; 148 option (google.api.http) = { 149 get: "/v1alpha/{name=projects/*/locations/*/instanceOSPoliciesCompliances/*}" 150 }; 151 option (google.api.method_signature) = "name"; 152 } 153 154 // List OS policies compliance data for all Compute Engine VM instances in the 155 // specified zone. 156 rpc ListInstanceOSPoliciesCompliances(ListInstanceOSPoliciesCompliancesRequest) returns (ListInstanceOSPoliciesCompliancesResponse) { 157 option deprecated = true; 158 option (google.api.http) = { 159 get: "/v1alpha/{parent=projects/*/locations/*}/instanceOSPoliciesCompliances" 160 }; 161 option (google.api.method_signature) = "parent"; 162 } 163 164 // Get the OS policy asssignment report for the specified Compute Engine VM 165 // instance. 166 rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) returns (OSPolicyAssignmentReport) { 167 option (google.api.http) = { 168 get: "/v1alpha/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" 169 }; 170 option (google.api.method_signature) = "name"; 171 } 172 173 // List OS policy asssignment reports for all Compute Engine VM instances in 174 // the specified zone. 175 rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) returns (ListOSPolicyAssignmentReportsResponse) { 176 option (google.api.http) = { 177 get: "/v1alpha/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" 178 }; 179 option (google.api.method_signature) = "parent"; 180 } 181 182 // Get inventory data for the specified VM instance. If the VM has no 183 // associated inventory, the message `NOT_FOUND` is returned. 184 rpc GetInventory(GetInventoryRequest) returns (Inventory) { 185 option (google.api.http) = { 186 get: "/v1alpha/{name=projects/*/locations/*/instances/*/inventory}" 187 }; 188 option (google.api.method_signature) = "name"; 189 } 190 191 // List inventory data for all VM instances in the specified zone. 192 rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { 193 option (google.api.http) = { 194 get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/inventories" 195 }; 196 option (google.api.method_signature) = "parent"; 197 } 198 199 // Gets the vulnerability report for the specified VM instance. Only VMs with 200 // inventory data have vulnerability reports associated with them. 201 rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { 202 option (google.api.http) = { 203 get: "/v1alpha/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" 204 }; 205 option (google.api.method_signature) = "name"; 206 } 207 208 // List vulnerability reports for all VM instances in the specified zone. 209 rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { 210 option (google.api.http) = { 211 get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" 212 }; 213 option (google.api.method_signature) = "parent"; 214 } 215} 216