// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * OS Config API Client for Deno * ============================= * * OS management tools that can be used for patch management, patch compliance, and configuration management on VM instances. * * Docs: https://cloud.google.com/compute/docs/osconfig/rest * Source: https://googleapis.deno.dev/v1/osconfig:v2.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * OS management tools that can be used for patch management, patch compliance, * and configuration management on VM instances. */ export class OSConfig { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://osconfig.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Creates a new policy orchestrator under the given folder resource. `name` * field of the given orchestrator are ignored and instead replaced by a * product of `parent` and `policy_orchestrator_id`. Orchestrator state field * might be only set to `ACTIVE`, `STOPPED` or omitted (in which case, the * created resource will be in `ACTIVE` state anyway). * * @param parent Required. The parent resource name in the form of: * `organizations/{organization_id}/locations/global` * `folders/{folder_id}/locations/global` * `projects/{project_id_or_number}/locations/global` */ async foldersLocationsGlobalPolicyOrchestratorsCreate(parent: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: FoldersLocationsGlobalPolicyOrchestratorsCreateOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.policyOrchestratorId !== undefined) { url.searchParams.append("policyOrchestratorId", String(opts.policyOrchestratorId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an existing policy orchestrator resource, parented by a folder. * * @param name Required. Name of the resource to be deleted. */ async foldersLocationsGlobalPolicyOrchestratorsDelete(name: string, opts: FoldersLocationsGlobalPolicyOrchestratorsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Retrieves an existing policy orchestrator, parented by a folder. * * @param name Required. The resource name. */ async foldersLocationsGlobalPolicyOrchestratorsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__PolicyOrchestrator(data); } /** * Lists the policy orchestrators under the given parent folder resource. * * @param parent Required. The parent resource name. */ async foldersLocationsGlobalPolicyOrchestratorsList(parent: string, opts: FoldersLocationsGlobalPolicyOrchestratorsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse(data); } /** * Updates an existing policy orchestrator, parented by a folder. * * @param name Immutable. Identifier. In form of * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}` */ async foldersLocationsGlobalPolicyOrchestratorsPatch(name: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: FoldersLocationsGlobalPolicyOrchestratorsPatchOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); opts = serializeFoldersLocationsGlobalPolicyOrchestratorsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async foldersLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async foldersLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async foldersLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async foldersLocationsOperationsList(name: string, opts: FoldersLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Creates a new policy orchestrator under the given organizations resource. * `name` field of the given orchestrator are ignored and instead replaced by * a product of `parent` and `policy_orchestrator_id`. Orchestrator state * field might be only set to `ACTIVE`, `STOPPED` or omitted (in which case, * the created resource will be in `ACTIVE` state anyway). * * @param parent Required. The parent resource name in the form of: * `organizations/{organization_id}/locations/global` * `folders/{folder_id}/locations/global` * `projects/{project_id_or_number}/locations/global` */ async organizationsLocationsGlobalPolicyOrchestratorsCreate(parent: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: OrganizationsLocationsGlobalPolicyOrchestratorsCreateOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.policyOrchestratorId !== undefined) { url.searchParams.append("policyOrchestratorId", String(opts.policyOrchestratorId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an existing policy orchestrator resource, parented by an * organization. * * @param name Required. Name of the resource to be deleted. */ async organizationsLocationsGlobalPolicyOrchestratorsDelete(name: string, opts: OrganizationsLocationsGlobalPolicyOrchestratorsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Retrieves an existing policy orchestrator, parented by an organization. * * @param name Required. The resource name. */ async organizationsLocationsGlobalPolicyOrchestratorsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__PolicyOrchestrator(data); } /** * Lists the policy orchestrators under the given parent organization * resource. * * @param parent Required. The parent resource name. */ async organizationsLocationsGlobalPolicyOrchestratorsList(parent: string, opts: OrganizationsLocationsGlobalPolicyOrchestratorsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse(data); } /** * Updates an existing policy orchestrator, parented by an organization. * * @param name Immutable. Identifier. In form of * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}` */ async organizationsLocationsGlobalPolicyOrchestratorsPatch(name: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: OrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); opts = serializeOrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async organizationsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async organizationsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async organizationsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async organizationsLocationsOperationsList(name: string, opts: OrganizationsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Creates a new policy orchestrator under the given project resource. `name` * field of the given orchestrator are ignored and instead replaced by a * product of `parent` and `policy_orchestrator_id`. Orchestrator state field * might be only set to `ACTIVE`, `STOPPED` or omitted (in which case, the * created resource will be in `ACTIVE` state anyway). * * @param parent Required. The parent resource name in the form of: * `organizations/{organization_id}/locations/global` * `folders/{folder_id}/locations/global` * `projects/{project_id_or_number}/locations/global` */ async projectsLocationsGlobalPolicyOrchestratorsCreate(parent: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: ProjectsLocationsGlobalPolicyOrchestratorsCreateOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.policyOrchestratorId !== undefined) { url.searchParams.append("policyOrchestratorId", String(opts.policyOrchestratorId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an existing policy orchestrator resource, parented by a project. * * @param name Required. Name of the resource to be deleted. */ async projectsLocationsGlobalPolicyOrchestratorsDelete(name: string, opts: ProjectsLocationsGlobalPolicyOrchestratorsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Retrieves an existing policy orchestrator, parented by a project. * * @param name Required. The resource name. */ async projectsLocationsGlobalPolicyOrchestratorsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__PolicyOrchestrator(data); } /** * Lists the policy orchestrators under the given parent project resource. * * @param parent Required. The parent resource name. */ async projectsLocationsGlobalPolicyOrchestratorsList(parent: string, opts: ProjectsLocationsGlobalPolicyOrchestratorsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/policyOrchestrators`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse(data); } /** * Updates an existing policy orchestrator, parented by a project. * * @param name Immutable. Identifier. In form of * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}` * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}` */ async projectsLocationsGlobalPolicyOrchestratorsPatch(name: string, req: GoogleCloudOsconfigV2__PolicyOrchestrator, opts: ProjectsLocationsGlobalPolicyOrchestratorsPatchOptions = {}): Promise { req = serializeGoogleCloudOsconfigV2__PolicyOrchestrator(req); opts = serializeProjectsLocationsGlobalPolicyOrchestratorsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Message encapsulating a value that can be either absolute ("fixed") or * relative ("percent") to a value. */ export interface FixedOrPercent { /** * Specifies a fixed value. */ fixed?: number; /** * Specifies the relative value defined as a percentage, which will be * multiplied by a reference value. */ percent?: number; } /** * Additional options for * OSConfig#foldersLocationsGlobalPolicyOrchestratorsCreate. */ export interface FoldersLocationsGlobalPolicyOrchestratorsCreateOptions { /** * Required. The logical identifier of the policy orchestrator, with the * following restrictions: * Must contain only lowercase letters, numbers, and * hyphens. * Must start with a letter. * Must be between 1-63 characters. * * Must end with a number or a letter. * Must be unique within the parent. */ policyOrchestratorId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#foldersLocationsGlobalPolicyOrchestratorsDelete. */ export interface FoldersLocationsGlobalPolicyOrchestratorsDeleteOptions { /** * Optional. The current etag of the policy orchestrator. If an etag is * provided and does not match the current etag of the policy orchestrator, * deletion will be blocked and an ABORTED error will be returned. */ etag?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#foldersLocationsGlobalPolicyOrchestratorsList. */ export interface FoldersLocationsGlobalPolicyOrchestratorsListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * OSConfig#foldersLocationsGlobalPolicyOrchestratorsPatch. */ export interface FoldersLocationsGlobalPolicyOrchestratorsPatchOptions { /** * Optional. The list of fields to merge into the existing policy * orchestrator. A special ["*"] field mask can be used to simply replace the * entire resource. Otherwise, for all paths referenced in the mask, following * merge rules are used: * output only fields are ignored, * primitive fields * are replaced, * repeated fields are replaced, * map fields are merged key * by key, * message fields are cleared if not set in the request, otherwise * they are merged recursively (in particular - message fields set to an empty * message has no side effects) If field mask (or its paths) is not specified, * it is automatically inferred from the request using following rules: * * primitive fields are listed, if set to a non-default value (as there is no * way to distinguish between default and unset value), * map and repeated * fields are listed, * `google.protobuf.Any` fields are listed, * other * message fields are traversed recursively. Note: implicit mask does not * allow clearing fields. */ updateMask?: string /* FieldMask */; } function serializeFoldersLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): FoldersLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeFoldersLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): FoldersLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for OSConfig#foldersLocationsOperationsList. */ export interface FoldersLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Represents the metadata of a generic long-running operation. */ export interface GoogleCloudOsconfigCommonV1__OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Represents the metadata of a generic long-running operation. */ export interface GoogleCloudOsconfigCommonV1alpha__OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Represents the metadata of a generic long-running operation. */ export interface GoogleCloudOsconfigCommonV1main__OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * OS policy assignment operation metadata provided by OS policy assignment API * methods that return long running operations. */ export interface GoogleCloudOsconfigV1__OSPolicyAssignmentOperationMetadata { /** * The OS policy assignment API method. */ apiMethod?: | "API_METHOD_UNSPECIFIED" | "CREATE" | "UPDATE" | "DELETE"; /** * Reference to the `OSPolicyAssignment` API resource. Format: * `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` */ osPolicyAssignment?: string; /** * Rollout start time */ rolloutStartTime?: Date; /** * State of the rollout */ rolloutState?: | "ROLLOUT_STATE_UNSPECIFIED" | "IN_PROGRESS" | "CANCELLING" | "CANCELLED" | "SUCCEEDED"; /** * Rollout update time */ rolloutUpdateTime?: Date; } function serializeGoogleCloudOsconfigV1__OSPolicyAssignmentOperationMetadata(data: any): GoogleCloudOsconfigV1__OSPolicyAssignmentOperationMetadata { return { ...data, rolloutStartTime: data["rolloutStartTime"] !== undefined ? data["rolloutStartTime"].toISOString() : undefined, rolloutUpdateTime: data["rolloutUpdateTime"] !== undefined ? data["rolloutUpdateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudOsconfigV1__OSPolicyAssignmentOperationMetadata(data: any): GoogleCloudOsconfigV1__OSPolicyAssignmentOperationMetadata { return { ...data, rolloutStartTime: data["rolloutStartTime"] !== undefined ? new Date(data["rolloutStartTime"]) : undefined, rolloutUpdateTime: data["rolloutUpdateTime"] !== undefined ? new Date(data["rolloutUpdateTime"]) : undefined, }; } /** * Response for the list policy orchestrator resources. */ export interface GoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The policy orchestrators for the specified parent resource. */ policyOrchestrators?: GoogleCloudOsconfigV2__PolicyOrchestrator[]; /** * Locations that could not be reached. */ unreachable?: string[]; } function serializeGoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse(data: any): GoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse { return { ...data, policyOrchestrators: data["policyOrchestrators"] !== undefined ? data["policyOrchestrators"].map((item: any) => (serializeGoogleCloudOsconfigV2__PolicyOrchestrator(item))) : undefined, }; } function deserializeGoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse(data: any): GoogleCloudOsconfigV2__ListPolicyOrchestratorsResponse { return { ...data, policyOrchestrators: data["policyOrchestrators"] !== undefined ? data["policyOrchestrators"].map((item: any) => (deserializeGoogleCloudOsconfigV2__PolicyOrchestrator(item))) : undefined, }; } /** * Represents the metadata of the long-running operation. */ export interface GoogleCloudOsconfigV2__OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Represents a resource that is being orchestrated by the policy orchestrator. */ export interface GoogleCloudOsconfigV2__OrchestratedResource { /** * Optional. ID of the resource to be used while generating set of affected * resources. For UPSERT action the value is auto-generated during * PolicyOrchestrator creation when not set. When the value is set it should * following next restrictions: * Must contain only lowercase letters, * numbers, and hyphens. * Must start with a letter. * Must be between 1-63 * characters. * Must end with a number or a letter. * Must be unique within * the project. For DELETE action, ID must be specified explicitly during * PolicyOrchestrator creation. */ id?: string; /** * Optional. OSPolicyAssignment resource to be created, updated or deleted. * Name field is ignored and replace with a generated value. With this field * set, orchestrator will perform actions on * `project/{project}/locations/{zone}/osPolicyAssignments/{resource_id}` * resources, where `project` and `zone` pairs come from the expanded scope, * and `resource_id` comes from the `resource_id` field of orchestrator * resource. */ osPolicyAssignmentV1Payload?: OSPolicyAssignment; } function serializeGoogleCloudOsconfigV2__OrchestratedResource(data: any): GoogleCloudOsconfigV2__OrchestratedResource { return { ...data, osPolicyAssignmentV1Payload: data["osPolicyAssignmentV1Payload"] !== undefined ? serializeOSPolicyAssignment(data["osPolicyAssignmentV1Payload"]) : undefined, }; } function deserializeGoogleCloudOsconfigV2__OrchestratedResource(data: any): GoogleCloudOsconfigV2__OrchestratedResource { return { ...data, osPolicyAssignmentV1Payload: data["osPolicyAssignmentV1Payload"] !== undefined ? deserializeOSPolicyAssignment(data["osPolicyAssignmentV1Payload"]) : undefined, }; } /** * Defines a set of selectors which drive which resources are in scope of * policy orchestration. */ export interface GoogleCloudOsconfigV2__OrchestrationScope { /** * Optional. Selectors of the orchestration scope. There is a logical AND * between each selector defined. When there is no explicit * `ResourceHierarchySelector` selector specified, the scope is by default * bounded to the parent of the policy orchestrator resource. */ selectors?: GoogleCloudOsconfigV2_OrchestrationScope_Selector[]; } /** * PolicyOrchestrator helps managing project+zone level policy resources (e.g. * OS Policy Assignments), by providing tools to create, update and delete them * across projects and locations, at scale. Policy orchestrator functions as an * endless loop. Each iteration orchestrator computes a set of resources that * should be affected, then progressively applies changes to them. If for some * reason this set of resources changes over time (e.g. new projects are added), * the future loop iterations will address that. Orchestrator can either upsert * or delete policy resources. For more details, see the description of the * `action`, and `orchestrated_resource` fields. Note that policy orchestrator * do not "manage" the resources it creates. Every iteration is independent and * only minimal history of past actions is retained (apart from Cloud Logging). * If orchestrator gets deleted, it does not affect the resources it created in * the past. Those will remain where they were. Same applies if projects are * removed from the orchestrator's scope. */ export interface GoogleCloudOsconfigV2__PolicyOrchestrator { /** * Required. Action to be done by the orchestrator in * `projects/{project_id}/zones/{zone_id}` locations defined by the * `orchestration_scope`. Allowed values: - `UPSERT` - Orchestrator will * create or update target resources. - `DELETE` - Orchestrator will delete * target resources, if they exist */ action?: string; /** * Output only. Timestamp when the policy orchestrator resource was created. */ readonly createTime?: Date; /** * Optional. Freeform text describing the purpose of the resource. */ description?: string; /** * Output only. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ readonly etag?: string; /** * Optional. Labels as key value pairs */ labels?: { [key: string]: string }; /** * Immutable. Identifier. In form of * * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}` * * * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}` * * * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}` */ name?: string; /** * Required. Resource to be orchestrated by the policy orchestrator. */ orchestratedResource?: GoogleCloudOsconfigV2__OrchestratedResource; /** * Optional. Defines scope for the orchestration, in context of the enclosing * PolicyOrchestrator resource. Scope is expanded into a list of pairs, in * which the rollout action will take place. Expansion starts with a Folder * resource parenting the PolicyOrchestrator resource: - All the descendant * projects are listed. - List of project is cross joined with a list of all * available zones. - Resulting list of pairs is filtered according to the * selectors. */ orchestrationScope?: GoogleCloudOsconfigV2__OrchestrationScope; /** * Output only. State of the orchestration. */ readonly orchestrationState?: GoogleCloudOsconfigV2_PolicyOrchestrator_OrchestrationState; /** * Output only. Set to true, if the there are ongoing changes being applied * by the orchestrator. */ readonly reconciling?: boolean; /** * Optional. State of the orchestrator. Can be updated to change orchestrator * behaviour. Allowed values: - `ACTIVE` - orchestrator is actively looking * for actions to be taken. - `STOPPED` - orchestrator won't make any changes. * Note: There might be more states added in the future. We use string here * instead of an enum, to avoid the need of propagating new states to all the * client code. */ state?: string; /** * Output only. Timestamp when the policy orchestrator resource was last * modified. */ readonly updateTime?: Date; } function serializeGoogleCloudOsconfigV2__PolicyOrchestrator(data: any): GoogleCloudOsconfigV2__PolicyOrchestrator { return { ...data, orchestratedResource: data["orchestratedResource"] !== undefined ? serializeGoogleCloudOsconfigV2__OrchestratedResource(data["orchestratedResource"]) : undefined, }; } function deserializeGoogleCloudOsconfigV2__PolicyOrchestrator(data: any): GoogleCloudOsconfigV2__PolicyOrchestrator { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, orchestratedResource: data["orchestratedResource"] !== undefined ? deserializeGoogleCloudOsconfigV2__OrchestratedResource(data["orchestratedResource"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Selector containing locations in scope. */ export interface GoogleCloudOsconfigV2_OrchestrationScope_LocationSelector { /** * Optional. Names of the locations in scope. Format: `us-central1-a` */ includedLocations?: string[]; } /** * Selector containing Cloud Resource Manager resource hierarchy nodes. */ export interface GoogleCloudOsconfigV2_OrchestrationScope_ResourceHierarchySelector { /** * Optional. Names of the folders in scope. Format: `folders/{folder_id}` */ includedFolders?: string[]; /** * Optional. Names of the projects in scope. Format: * `projects/{project_number}` */ includedProjects?: string[]; } /** * Selector for the resources in scope of orchestration. */ export interface GoogleCloudOsconfigV2_OrchestrationScope_Selector { /** * Selector for selecting locations. */ locationSelector?: GoogleCloudOsconfigV2_OrchestrationScope_LocationSelector; /** * Selector for selecting resource hierarchy. */ resourceHierarchySelector?: GoogleCloudOsconfigV2_OrchestrationScope_ResourceHierarchySelector; } /** * Describes the state of a single iteration of the orchestrator. */ export interface GoogleCloudOsconfigV2_PolicyOrchestrator_IterationState { /** * Output only. Error thrown in the wave iteration. */ readonly error?: Status; /** * Output only. Number of orchestration actions which failed so far. For more * details, query the Cloud Logs. */ readonly failedActions?: bigint; /** * Output only. Finish time of the wave iteration. */ readonly finishTime?: Date; /** * Output only. Unique identifier of the iteration. */ readonly iterationId?: string; /** * Output only. Overall number of actions done by the orchestrator so far. */ readonly performedActions?: bigint; /** * Output only. An estimated percentage of the progress. Number between 0 and * 100. */ readonly progress?: number; /** * Output only. Start time of the wave iteration. */ readonly startTime?: Date; /** * Output only. State of the iteration. */ readonly state?: | "STATE_UNSPECIFIED" | "PROCESSING" | "COMPLETED" | "FAILED" | "CANCELLED" | "UNKNOWN"; } /** * Describes the state of the orchestration process. */ export interface GoogleCloudOsconfigV2_PolicyOrchestrator_OrchestrationState { /** * Output only. Current Wave iteration state. */ readonly currentIterationState?: GoogleCloudOsconfigV2_PolicyOrchestrator_IterationState; /** * Output only. Previous Wave iteration state. */ readonly previousIterationState?: GoogleCloudOsconfigV2_PolicyOrchestrator_IterationState; } /** * Represents the metadata of the long-running operation. */ export interface GoogleCloudOsconfigV2beta__OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * This is proto2's version of MessageSet. DEPRECATED: DO NOT USE FOR NEW * FIELDS. If you are using editions or proto2, please make your own extendable * messages for your use case. If you are using proto3, please use `Any` * instead. MessageSet was the implementation of extensions for proto1. When * proto2 was introduced, extensions were implemented as a first-class feature. * This schema for MessageSet was meant to be a "bridge" solution to migrate * MessageSet-bearing messages from proto1 to proto2. This schema has been * open-sourced only to facilitate the migration of Google products with * MessageSet-bearing messages to open-source environments. */ export interface MessageSet { } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Additional options for * OSConfig#organizationsLocationsGlobalPolicyOrchestratorsCreate. */ export interface OrganizationsLocationsGlobalPolicyOrchestratorsCreateOptions { /** * Required. The logical identifier of the policy orchestrator, with the * following restrictions: * Must contain only lowercase letters, numbers, and * hyphens. * Must start with a letter. * Must be between 1-63 characters. * * Must end with a number or a letter. * Must be unique within the parent. */ policyOrchestratorId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#organizationsLocationsGlobalPolicyOrchestratorsDelete. */ export interface OrganizationsLocationsGlobalPolicyOrchestratorsDeleteOptions { /** * Optional. The current etag of the policy orchestrator. If an etag is * provided and does not match the current etag of the policy orchestrator, * deletion will be blocked and an ABORTED error will be returned. */ etag?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#organizationsLocationsGlobalPolicyOrchestratorsList. */ export interface OrganizationsLocationsGlobalPolicyOrchestratorsListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * OSConfig#organizationsLocationsGlobalPolicyOrchestratorsPatch. */ export interface OrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions { /** * Optional. The list of fields to merge into the existing policy * orchestrator. A special ["*"] field mask can be used to simply replace the * entire resource. Otherwise, for all paths referenced in the mask, following * merge rules are used: * output only fields are ignored, * primitive fields * are replaced, * repeated fields are replaced, * map fields are merged key * by key, * message fields are cleared if not set in the request, otherwise * they are merged recursively (in particular - message fields set to an empty * message has no side effects) If field mask (or its paths) is not specified, * it is automatically inferred from the request using following rules: * * primitive fields are listed, if set to a non-default value (as there is no * way to distinguish between default and unset value), * map and repeated * fields are listed, * `google.protobuf.Any` fields are listed, * other * message fields are traversed recursively. Note: implicit mask does not * allow clearing fields. */ updateMask?: string /* FieldMask */; } function serializeOrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): OrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeOrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): OrganizationsLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for OSConfig#organizationsLocationsOperationsList. */ export interface OrganizationsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * An OS policy defines the desired state configuration for a VM. */ export interface OSPolicy { /** * This flag determines the OS policy compliance status when none of the * resource groups within the policy are applicable for a VM. Set this value * to `true` if the policy needs to be reported as compliant even if the * policy has nothing to validate or enforce. */ allowNoResourceGroupMatch?: boolean; /** * Policy description. Length of the description is limited to 1024 * characters. */ description?: string; /** * Required. The id of the OS policy with the following restrictions: * Must * contain only lowercase letters, numbers, and hyphens. * Must start with a * letter. * Must be between 1-63 characters. * Must end with a number or a * letter. * Must be unique within the assignment. */ id?: string; /** * Required. Policy mode */ mode?: | "MODE_UNSPECIFIED" | "VALIDATION" | "ENFORCEMENT"; /** * Required. List of resource groups for the policy. For a particular VM, * resource groups are evaluated in the order specified and the first resource * group that is applicable is selected and the rest are ignored. If none of * the resource groups are applicable for a VM, the VM is considered to be * non-compliant w.r.t this policy. This behavior can be toggled by the flag * `allow_no_resource_group_match` */ resourceGroups?: OSPolicyResourceGroup[]; } function serializeOSPolicy(data: any): OSPolicy { return { ...data, resourceGroups: data["resourceGroups"] !== undefined ? data["resourceGroups"].map((item: any) => (serializeOSPolicyResourceGroup(item))) : undefined, }; } function deserializeOSPolicy(data: any): OSPolicy { return { ...data, resourceGroups: data["resourceGroups"] !== undefined ? data["resourceGroups"].map((item: any) => (deserializeOSPolicyResourceGroup(item))) : undefined, }; } /** * OS policy assignment is an API resource that is used to apply a set of OS * policies to a dynamically targeted group of Compute Engine VM instances. An * OS policy is used to define the desired state configuration for a Compute * Engine VM instance through a set of configuration resources that provide * capabilities such as installing or removing software packages, or executing a * script. For more information about the OS policy resource definitions and * examples, see [OS policy and OS policy * assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). */ export interface OSPolicyAssignment { /** * Output only. Indicates that this revision has been successfully rolled out * in this zone and new VMs will be assigned OS policies from this revision. * For a given OS policy assignment, there is only one revision with a value * of `true` for this field. */ readonly baseline?: boolean; /** * Output only. Indicates that this revision deletes the OS policy * assignment. */ readonly deleted?: boolean; /** * OS policy assignment description. Length of the description is limited to * 1024 characters. */ description?: string; /** * The etag for this OS policy assignment. If this is provided on update, it * must match the server's etag. */ etag?: string; /** * Required. Filter to select VMs. */ instanceFilter?: OSPolicyAssignmentInstanceFilter; /** * Resource name. Format: * `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` * This field is ignored when you create an OS policy assignment. */ name?: string; /** * Required. List of OS policies to be applied to the VMs. */ osPolicies?: OSPolicy[]; /** * Output only. Indicates that reconciliation is in progress for the * revision. This value is `true` when the `rollout_state` is one of: * * IN_PROGRESS * CANCELLING */ readonly reconciling?: boolean; /** * Output only. The timestamp that the revision was created. */ readonly revisionCreateTime?: Date; /** * Output only. The assignment revision ID A new revision is committed * whenever a rollout is triggered for a OS policy assignment */ readonly revisionId?: string; /** * Required. Rollout to deploy the OS policy assignment. A rollout is * triggered in the following situations: 1) OSPolicyAssignment is created. 2) * OSPolicyAssignment is updated and the update contains changes to one of the * following fields: - instance_filter - os_policies 3) OSPolicyAssignment is * deleted. */ rollout?: OSPolicyAssignmentRollout; /** * Output only. OS policy assignment rollout state */ readonly rolloutState?: | "ROLLOUT_STATE_UNSPECIFIED" | "IN_PROGRESS" | "CANCELLING" | "CANCELLED" | "SUCCEEDED"; /** * Output only. Server generated unique id for the OS policy assignment * resource. */ readonly uid?: string; } function serializeOSPolicyAssignment(data: any): OSPolicyAssignment { return { ...data, osPolicies: data["osPolicies"] !== undefined ? data["osPolicies"].map((item: any) => (serializeOSPolicy(item))) : undefined, rollout: data["rollout"] !== undefined ? serializeOSPolicyAssignmentRollout(data["rollout"]) : undefined, }; } function deserializeOSPolicyAssignment(data: any): OSPolicyAssignment { return { ...data, osPolicies: data["osPolicies"] !== undefined ? data["osPolicies"].map((item: any) => (deserializeOSPolicy(item))) : undefined, revisionCreateTime: data["revisionCreateTime"] !== undefined ? new Date(data["revisionCreateTime"]) : undefined, rollout: data["rollout"] !== undefined ? deserializeOSPolicyAssignmentRollout(data["rollout"]) : undefined, }; } /** * Filters to select target VMs for an assignment. If more than one filter * criteria is specified below, a VM will be selected if and only if it * satisfies all of them. */ export interface OSPolicyAssignmentInstanceFilter { /** * Target all VMs in the project. If true, no other criteria is permitted. */ all?: boolean; /** * List of label sets used for VM exclusion. If the list has more than one * label set, the VM is excluded if any of the label sets are applicable for * the VM. */ exclusionLabels?: OSPolicyAssignmentLabelSet[]; /** * List of label sets used for VM inclusion. If the list has more than one * `LabelSet`, the VM is included if any of the label sets are applicable for * the VM. */ inclusionLabels?: OSPolicyAssignmentLabelSet[]; /** * List of inventories to select VMs. A VM is selected if its inventory data * matches at least one of the following inventories. */ inventories?: OSPolicyAssignmentInstanceFilterInventory[]; } /** * VM inventory details. */ export interface OSPolicyAssignmentInstanceFilterInventory { /** * Required. The OS short name */ osShortName?: string; /** * The OS version Prefix matches are supported if asterisk(*) is provided as * the last character. For example, to match all versions with a major version * of `7`, specify the following value for this field `7.*` An empty string * matches all OS versions. */ osVersion?: string; } /** * Message representing label set. * A label is a key value pair set for a VM. * * A LabelSet is a set of labels. * Labels within a LabelSet are ANDed. In * other words, a LabelSet is applicable for a VM only if it matches all the * labels in the LabelSet. * Example: A LabelSet with 2 labels: `env=prod` and * `type=webserver` will only be applicable for those VMs with both labels * present. */ export interface OSPolicyAssignmentLabelSet { /** * Labels are identified by key/value pairs in this map. A VM should contain * all the key/value pairs specified in this map to be selected. */ labels?: { [key: string]: string }; } /** * OS policy assignment operation metadata provided by OS policy assignment API * methods that return long running operations. */ export interface OSPolicyAssignmentOperationMetadata { /** * The OS policy assignment API method. */ apiMethod?: | "API_METHOD_UNSPECIFIED" | "CREATE" | "UPDATE" | "DELETE"; /** * Reference to the `OSPolicyAssignment` API resource. Format: * `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` */ osPolicyAssignment?: string; /** * Rollout start time */ rolloutStartTime?: Date; /** * State of the rollout */ rolloutState?: | "ROLLOUT_STATE_UNSPECIFIED" | "IN_PROGRESS" | "CANCELLING" | "CANCELLED" | "SUCCEEDED"; /** * Rollout update time */ rolloutUpdateTime?: Date; } function serializeOSPolicyAssignmentOperationMetadata(data: any): OSPolicyAssignmentOperationMetadata { return { ...data, rolloutStartTime: data["rolloutStartTime"] !== undefined ? data["rolloutStartTime"].toISOString() : undefined, rolloutUpdateTime: data["rolloutUpdateTime"] !== undefined ? data["rolloutUpdateTime"].toISOString() : undefined, }; } function deserializeOSPolicyAssignmentOperationMetadata(data: any): OSPolicyAssignmentOperationMetadata { return { ...data, rolloutStartTime: data["rolloutStartTime"] !== undefined ? new Date(data["rolloutStartTime"]) : undefined, rolloutUpdateTime: data["rolloutUpdateTime"] !== undefined ? new Date(data["rolloutUpdateTime"]) : undefined, }; } /** * Message to configure the rollout at the zonal level for the OS policy * assignment. */ export interface OSPolicyAssignmentRollout { /** * Required. The maximum number (or percentage) of VMs per zone to disrupt at * any given moment. */ disruptionBudget?: FixedOrPercent; /** * Required. This determines the minimum duration of time to wait after the * configuration changes are applied through the current rollout. A VM * continues to count towards the `disruption_budget` at least until this * duration of time has passed after configuration changes are applied. */ minWaitDuration?: number /* Duration */; } function serializeOSPolicyAssignmentRollout(data: any): OSPolicyAssignmentRollout { return { ...data, minWaitDuration: data["minWaitDuration"] !== undefined ? data["minWaitDuration"] : undefined, }; } function deserializeOSPolicyAssignmentRollout(data: any): OSPolicyAssignmentRollout { return { ...data, minWaitDuration: data["minWaitDuration"] !== undefined ? data["minWaitDuration"] : undefined, }; } /** * Filtering criteria to select VMs based on inventory details. */ export interface OSPolicyInventoryFilter { /** * Required. The OS short name */ osShortName?: string; /** * The OS version Prefix matches are supported if asterisk(*) is provided as * the last character. For example, to match all versions with a major version * of `7`, specify the following value for this field `7.*` An empty string * matches all OS versions. */ osVersion?: string; } /** * An OS policy resource is used to define the desired state configuration and * provides a specific functionality like installing/removing packages, * executing a script etc. The system ensures that resources are always in their * desired state by taking necessary actions if they have drifted from their * desired state. */ export interface OSPolicyResource { /** * Exec resource */ exec?: OSPolicyResourceExecResource; /** * File resource */ file?: OSPolicyResourceFileResource; /** * Required. The id of the resource with the following restrictions: * Must * contain only lowercase letters, numbers, and hyphens. * Must start with a * letter. * Must be between 1-63 characters. * Must end with a number or a * letter. * Must be unique within the OS policy. */ id?: string; /** * Package resource */ pkg?: OSPolicyResourcePackageResource; /** * Package repository resource */ repository?: OSPolicyResourceRepositoryResource; } function serializeOSPolicyResource(data: any): OSPolicyResource { return { ...data, exec: data["exec"] !== undefined ? serializeOSPolicyResourceExecResource(data["exec"]) : undefined, file: data["file"] !== undefined ? serializeOSPolicyResourceFileResource(data["file"]) : undefined, pkg: data["pkg"] !== undefined ? serializeOSPolicyResourcePackageResource(data["pkg"]) : undefined, }; } function deserializeOSPolicyResource(data: any): OSPolicyResource { return { ...data, exec: data["exec"] !== undefined ? deserializeOSPolicyResourceExecResource(data["exec"]) : undefined, file: data["file"] !== undefined ? deserializeOSPolicyResourceFileResource(data["file"]) : undefined, pkg: data["pkg"] !== undefined ? deserializeOSPolicyResourcePackageResource(data["pkg"]) : undefined, }; } /** * A resource that allows executing scripts on the VM. The `ExecResource` has 2 * stages: `validate` and `enforce` and both stages accept a script as an * argument to execute. When the `ExecResource` is applied by the agent, it * first executes the script in the `validate` stage. The `validate` stage can * signal that the `ExecResource` is already in the desired state by returning * an exit code of `100`. If the `ExecResource` is not in the desired state, it * should return an exit code of `101`. Any other exit code returned by this * stage is considered an error. If the `ExecResource` is not in the desired * state based on the exit code from the `validate` stage, the agent proceeds to * execute the script from the `enforce` stage. If the `ExecResource` is already * in the desired state, the `enforce` stage will not be run. Similar to * `validate` stage, the `enforce` stage should return an exit code of `100` to * indicate that the resource in now in its desired state. Any other exit code * is considered an error. NOTE: An exit code of `100` was chosen over `0` (and * `101` vs `1`) to have an explicit indicator of `in desired state`, `not in * desired state` and errors. Because, for example, Powershell will always * return an exit code of `0` unless an `exit` statement is provided in the * script. So, for reasons of consistency and being explicit, exit codes `100` * and `101` were chosen. */ export interface OSPolicyResourceExecResource { /** * What to run to bring this resource into the desired state. An exit code of * 100 indicates "success", any other exit code indicates a failure running * enforce. */ enforce?: OSPolicyResourceExecResourceExec; /** * Required. What to run to validate this resource is in the desired state. * An exit code of 100 indicates "in desired state", and exit code of 101 * indicates "not in desired state". Any other exit code indicates a failure * running validate. */ validate?: OSPolicyResourceExecResourceExec; } function serializeOSPolicyResourceExecResource(data: any): OSPolicyResourceExecResource { return { ...data, enforce: data["enforce"] !== undefined ? serializeOSPolicyResourceExecResourceExec(data["enforce"]) : undefined, validate: data["validate"] !== undefined ? serializeOSPolicyResourceExecResourceExec(data["validate"]) : undefined, }; } function deserializeOSPolicyResourceExecResource(data: any): OSPolicyResourceExecResource { return { ...data, enforce: data["enforce"] !== undefined ? deserializeOSPolicyResourceExecResourceExec(data["enforce"]) : undefined, validate: data["validate"] !== undefined ? deserializeOSPolicyResourceExecResourceExec(data["validate"]) : undefined, }; } /** * A file or script to execute. */ export interface OSPolicyResourceExecResourceExec { /** * Optional arguments to pass to the source during execution. */ args?: string[]; /** * A remote or local file. */ file?: OSPolicyResourceFile; /** * Required. The script interpreter to use. */ interpreter?: | "INTERPRETER_UNSPECIFIED" | "NONE" | "SHELL" | "POWERSHELL"; /** * Only recorded for enforce Exec. Path to an output file (that is created by * this Exec) whose content will be recorded in OSPolicyResourceCompliance * after a successful run. Absence or failure to read this file will result in * this ExecResource being non-compliant. Output file size is limited to 500K * bytes. */ outputFilePath?: string; /** * An inline script. The size of the script is limited to 32KiB. */ script?: string; } function serializeOSPolicyResourceExecResourceExec(data: any): OSPolicyResourceExecResourceExec { return { ...data, file: data["file"] !== undefined ? serializeOSPolicyResourceFile(data["file"]) : undefined, }; } function deserializeOSPolicyResourceExecResourceExec(data: any): OSPolicyResourceExecResourceExec { return { ...data, file: data["file"] !== undefined ? deserializeOSPolicyResourceFile(data["file"]) : undefined, }; } /** * A remote or local file. */ export interface OSPolicyResourceFile { /** * Defaults to false. When false, files are subject to validations based on * the file type: Remote: A checksum must be specified. Cloud Storage: An * object generation number must be specified. */ allowInsecure?: boolean; /** * A Cloud Storage object. */ gcs?: OSPolicyResourceFileGcs; /** * A local path within the VM to use. */ localPath?: string; /** * A generic remote file. */ remote?: OSPolicyResourceFileRemote; } function serializeOSPolicyResourceFile(data: any): OSPolicyResourceFile { return { ...data, gcs: data["gcs"] !== undefined ? serializeOSPolicyResourceFileGcs(data["gcs"]) : undefined, }; } function deserializeOSPolicyResourceFile(data: any): OSPolicyResourceFile { return { ...data, gcs: data["gcs"] !== undefined ? deserializeOSPolicyResourceFileGcs(data["gcs"]) : undefined, }; } /** * Specifies a file available as a Cloud Storage Object. */ export interface OSPolicyResourceFileGcs { /** * Required. Bucket of the Cloud Storage object. */ bucket?: string; /** * Generation number of the Cloud Storage object. */ generation?: bigint; /** * Required. Name of the Cloud Storage object. */ object?: string; } function serializeOSPolicyResourceFileGcs(data: any): OSPolicyResourceFileGcs { return { ...data, generation: data["generation"] !== undefined ? String(data["generation"]) : undefined, }; } function deserializeOSPolicyResourceFileGcs(data: any): OSPolicyResourceFileGcs { return { ...data, generation: data["generation"] !== undefined ? BigInt(data["generation"]) : undefined, }; } /** * Specifies a file available via some URI. */ export interface OSPolicyResourceFileRemote { /** * SHA256 checksum of the remote file. */ sha256Checksum?: string; /** * Required. URI from which to fetch the object. It should contain both the * protocol and path following the format `{protocol}://{location}`. */ uri?: string; } /** * A resource that manages the state of a file. */ export interface OSPolicyResourceFileResource { /** * A a file with this content. The size of the content is limited to 32KiB. */ content?: string; /** * A remote or local source. */ file?: OSPolicyResourceFile; /** * Required. The absolute path of the file within the VM. */ path?: string; /** * Consists of three octal digits which represent, in order, the permissions * of the owner, group, and other users for the file (similarly to the numeric * mode used in the linux chmod utility). Each digit represents a three bit * number with the 4 bit corresponding to the read permissions, the 2 bit * corresponds to the write bit, and the one bit corresponds to the execute * permission. Default behavior is 755. Below are some examples of permissions * and their associated values: read, write, and execute: 7 read and execute: * 5 read and write: 6 read only: 4 */ permissions?: string; /** * Required. Desired state of the file. */ state?: | "DESIRED_STATE_UNSPECIFIED" | "PRESENT" | "ABSENT" | "CONTENTS_MATCH"; } function serializeOSPolicyResourceFileResource(data: any): OSPolicyResourceFileResource { return { ...data, file: data["file"] !== undefined ? serializeOSPolicyResourceFile(data["file"]) : undefined, }; } function deserializeOSPolicyResourceFileResource(data: any): OSPolicyResourceFileResource { return { ...data, file: data["file"] !== undefined ? deserializeOSPolicyResourceFile(data["file"]) : undefined, }; } /** * Resource groups provide a mechanism to group OS policy resources. Resource * groups enable OS policy authors to create a single OS policy to be applied to * VMs running different operating Systems. When the OS policy is applied to a * target VM, the appropriate resource group within the OS policy is selected * based on the `OSFilter` specified within the resource group. */ export interface OSPolicyResourceGroup { /** * List of inventory filters for the resource group. The resources in this * resource group are applied to the target VM if it satisfies at least one of * the following inventory filters. For example, to apply this resource group * to VMs running either `RHEL` or `CentOS` operating systems, specify 2 items * for the list with following values: * inventory_filters[0].os_short_name='rhel' and * inventory_filters[1].os_short_name='centos' If the list is empty, this * resource group will be applied to the target VM unconditionally. */ inventoryFilters?: OSPolicyInventoryFilter[]; /** * Required. List of resources configured for this resource group. The * resources are executed in the exact order specified here. */ resources?: OSPolicyResource[]; } function serializeOSPolicyResourceGroup(data: any): OSPolicyResourceGroup { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeOSPolicyResource(item))) : undefined, }; } function deserializeOSPolicyResourceGroup(data: any): OSPolicyResourceGroup { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeOSPolicyResource(item))) : undefined, }; } /** * A resource that manages a system package. */ export interface OSPolicyResourcePackageResource { /** * A package managed by Apt. */ apt?: OSPolicyResourcePackageResourceAPT; /** * A deb package file. */ deb?: OSPolicyResourcePackageResourceDeb; /** * Required. The desired state the agent should maintain for this package. */ desiredState?: | "DESIRED_STATE_UNSPECIFIED" | "INSTALLED" | "REMOVED"; /** * A package managed by GooGet. */ googet?: OSPolicyResourcePackageResourceGooGet; /** * An MSI package. */ msi?: OSPolicyResourcePackageResourceMSI; /** * An rpm package file. */ rpm?: OSPolicyResourcePackageResourceRPM; /** * A package managed by YUM. */ yum?: OSPolicyResourcePackageResourceYUM; /** * A package managed by Zypper. */ zypper?: OSPolicyResourcePackageResourceZypper; } function serializeOSPolicyResourcePackageResource(data: any): OSPolicyResourcePackageResource { return { ...data, deb: data["deb"] !== undefined ? serializeOSPolicyResourcePackageResourceDeb(data["deb"]) : undefined, msi: data["msi"] !== undefined ? serializeOSPolicyResourcePackageResourceMSI(data["msi"]) : undefined, rpm: data["rpm"] !== undefined ? serializeOSPolicyResourcePackageResourceRPM(data["rpm"]) : undefined, }; } function deserializeOSPolicyResourcePackageResource(data: any): OSPolicyResourcePackageResource { return { ...data, deb: data["deb"] !== undefined ? deserializeOSPolicyResourcePackageResourceDeb(data["deb"]) : undefined, msi: data["msi"] !== undefined ? deserializeOSPolicyResourcePackageResourceMSI(data["msi"]) : undefined, rpm: data["rpm"] !== undefined ? deserializeOSPolicyResourcePackageResourceRPM(data["rpm"]) : undefined, }; } /** * A package managed by APT. - install: `apt-get update && apt-get -y install * [name]` - remove: `apt-get -y remove [name]` */ export interface OSPolicyResourcePackageResourceAPT { /** * Required. Package name. */ name?: string; } /** * A deb package file. dpkg packages only support INSTALLED state. */ export interface OSPolicyResourcePackageResourceDeb { /** * Whether dependencies should also be installed. - install when false: `dpkg * -i package` - install when true: `apt-get update && apt-get -y install * package.deb` */ pullDeps?: boolean; /** * Required. A deb package. */ source?: OSPolicyResourceFile; } function serializeOSPolicyResourcePackageResourceDeb(data: any): OSPolicyResourcePackageResourceDeb { return { ...data, source: data["source"] !== undefined ? serializeOSPolicyResourceFile(data["source"]) : undefined, }; } function deserializeOSPolicyResourcePackageResourceDeb(data: any): OSPolicyResourcePackageResourceDeb { return { ...data, source: data["source"] !== undefined ? deserializeOSPolicyResourceFile(data["source"]) : undefined, }; } /** * A package managed by GooGet. - install: `googet -noconfirm install package` * - remove: `googet -noconfirm remove package` */ export interface OSPolicyResourcePackageResourceGooGet { /** * Required. Package name. */ name?: string; } /** * An MSI package. MSI packages only support INSTALLED state. */ export interface OSPolicyResourcePackageResourceMSI { /** * Additional properties to use during installation. This should be in the * format of Property=Setting. Appended to the defaults of `ACTION=INSTALL * REBOOT=ReallySuppress`. */ properties?: string[]; /** * Required. The MSI package. */ source?: OSPolicyResourceFile; } function serializeOSPolicyResourcePackageResourceMSI(data: any): OSPolicyResourcePackageResourceMSI { return { ...data, source: data["source"] !== undefined ? serializeOSPolicyResourceFile(data["source"]) : undefined, }; } function deserializeOSPolicyResourcePackageResourceMSI(data: any): OSPolicyResourcePackageResourceMSI { return { ...data, source: data["source"] !== undefined ? deserializeOSPolicyResourceFile(data["source"]) : undefined, }; } /** * An RPM package file. RPM packages only support INSTALLED state. */ export interface OSPolicyResourcePackageResourceRPM { /** * Whether dependencies should also be installed. - install when false: `rpm * --upgrade --replacepkgs package.rpm` - install when true: `yum -y install * package.rpm` or `zypper -y install package.rpm` */ pullDeps?: boolean; /** * Required. An rpm package. */ source?: OSPolicyResourceFile; } function serializeOSPolicyResourcePackageResourceRPM(data: any): OSPolicyResourcePackageResourceRPM { return { ...data, source: data["source"] !== undefined ? serializeOSPolicyResourceFile(data["source"]) : undefined, }; } function deserializeOSPolicyResourcePackageResourceRPM(data: any): OSPolicyResourcePackageResourceRPM { return { ...data, source: data["source"] !== undefined ? deserializeOSPolicyResourceFile(data["source"]) : undefined, }; } /** * A package managed by YUM. - install: `yum -y install package` - remove: `yum * -y remove package` */ export interface OSPolicyResourcePackageResourceYUM { /** * Required. Package name. */ name?: string; } /** * A package managed by Zypper. - install: `zypper -y install package` - * remove: `zypper -y rm package` */ export interface OSPolicyResourcePackageResourceZypper { /** * Required. Package name. */ name?: string; } /** * A resource that manages a package repository. */ export interface OSPolicyResourceRepositoryResource { /** * An Apt Repository. */ apt?: OSPolicyResourceRepositoryResourceAptRepository; /** * A Goo Repository. */ goo?: OSPolicyResourceRepositoryResourceGooRepository; /** * A Yum Repository. */ yum?: OSPolicyResourceRepositoryResourceYumRepository; /** * A Zypper Repository. */ zypper?: OSPolicyResourceRepositoryResourceZypperRepository; } /** * Represents a single apt package repository. These will be added to a repo * file that will be managed at `/etc/apt/sources.list.d/google_osconfig.list`. */ export interface OSPolicyResourceRepositoryResourceAptRepository { /** * Required. Type of archive files in this repository. */ archiveType?: | "ARCHIVE_TYPE_UNSPECIFIED" | "DEB" | "DEB_SRC"; /** * Required. List of components for this repository. Must contain at least * one item. */ components?: string[]; /** * Required. Distribution of this repository. */ distribution?: string; /** * URI of the key file for this repository. The agent maintains a keyring at * `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. */ gpgKey?: string; /** * Required. URI for this repository. */ uri?: string; } /** * Represents a Goo package repository. These are added to a repo file that is * managed at `C:/ProgramData/GooGet/repos/google_osconfig.repo`. */ export interface OSPolicyResourceRepositoryResourceGooRepository { /** * Required. The name of the repository. */ name?: string; /** * Required. The url of the repository. */ url?: string; } /** * Represents a single yum package repository. These are added to a repo file * that is managed at `/etc/yum.repos.d/google_osconfig.repo`. */ export interface OSPolicyResourceRepositoryResourceYumRepository { /** * Required. The location of the repository directory. */ baseUrl?: string; /** * The display name of the repository. */ displayName?: string; /** * URIs of GPG keys. */ gpgKeys?: string[]; /** * Required. A one word, unique name for this repository. This is the `repo * id` in the yum config file and also the `display_name` if `display_name` is * omitted. This id is also used as the unique identifier when checking for * resource conflicts. */ id?: string; } /** * Represents a single zypper package repository. These are added to a repo * file that is managed at `/etc/zypp/repos.d/google_osconfig.repo`. */ export interface OSPolicyResourceRepositoryResourceZypperRepository { /** * Required. The location of the repository directory. */ baseUrl?: string; /** * The display name of the repository. */ displayName?: string; /** * URIs of GPG keys. */ gpgKeys?: string[]; /** * Required. A one word, unique name for this repository. This is the `repo * id` in the zypper config file and also the `display_name` if `display_name` * is omitted. This id is also used as the unique identifier when checking for * GuestPolicy conflicts. */ id?: string; } /** * Additional options for * OSConfig#projectsLocationsGlobalPolicyOrchestratorsCreate. */ export interface ProjectsLocationsGlobalPolicyOrchestratorsCreateOptions { /** * Required. The logical identifier of the policy orchestrator, with the * following restrictions: * Must contain only lowercase letters, numbers, and * hyphens. * Must start with a letter. * Must be between 1-63 characters. * * Must end with a number or a letter. * Must be unique within the parent. */ policyOrchestratorId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#projectsLocationsGlobalPolicyOrchestratorsDelete. */ export interface ProjectsLocationsGlobalPolicyOrchestratorsDeleteOptions { /** * Optional. The current etag of the policy orchestrator. If an etag is * provided and does not match the current etag of the policy orchestrator, * deletion will be blocked and an ABORTED error will be returned. */ etag?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * OSConfig#projectsLocationsGlobalPolicyOrchestratorsList. */ export interface ProjectsLocationsGlobalPolicyOrchestratorsListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * OSConfig#projectsLocationsGlobalPolicyOrchestratorsPatch. */ export interface ProjectsLocationsGlobalPolicyOrchestratorsPatchOptions { /** * Optional. The list of fields to merge into the existing policy * orchestrator. A special ["*"] field mask can be used to simply replace the * entire resource. Otherwise, for all paths referenced in the mask, following * merge rules are used: * output only fields are ignored, * primitive fields * are replaced, * repeated fields are replaced, * map fields are merged key * by key, * message fields are cleared if not set in the request, otherwise * they are merged recursively (in particular - message fields set to an empty * message has no side effects) If field mask (or its paths) is not specified, * it is automatically inferred from the request using following rules: * * primitive fields are listed, if set to a non-default value (as there is no * way to distinguish between default and unset value), * map and repeated * fields are listed, * `google.protobuf.Any` fields are listed, * other * message fields are traversed recursively. Note: implicit mask does not * allow clearing fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): ProjectsLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsGlobalPolicyOrchestratorsPatchOptions(data: any): ProjectsLocationsGlobalPolicyOrchestratorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for OSConfig#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * Wire-format for a Status object */ export interface StatusProto { /** * copybara:strip_begin(b/383363683) copybara:strip_end_and_replace optional * int32 canonical_code = 6; */ canonicalCode?: number; /** * Numeric code drawn from the space specified below. Often, this is the * canonical error space, and code is drawn from google3/util/task/codes.proto * copybara:strip_begin(b/383363683) copybara:strip_end_and_replace optional * int32 code = 1; */ code?: number; /** * Detail message copybara:strip_begin(b/383363683) * copybara:strip_end_and_replace optional string message = 3; */ message?: string; /** * message_set associates an arbitrary proto message with the status. * copybara:strip_begin(b/383363683) copybara:strip_end_and_replace optional * proto2.bridge.MessageSet message_set = 5; */ messageSet?: MessageSet; /** * copybara:strip_begin(b/383363683) Space to which this status belongs * copybara:strip_end_and_replace optional string space = 2; // Space to which * this status belongs */ space?: string; }