---
title: "POST /v1/{+parent}/unitOperations"
method: POST
path: "/v1/{+parent}/unitOperations"
tags: ["projects"]
---

# POST /v1/{+parent}/unitOperations

`POST /v1/{+parent}/unitOperations`

Create a new unit operation.

## Path parameters

- `parent` string, required

## Query parameters

- `requestId` string
- `unitOperationId` string
- `validateOnly` boolean

## Request body

- UnitOperation — UnitOperation encapsulates the intent of changing/interacting with the service component represented by the specific Unit. Multiple UnitOperations can be created (requested) and scheduled in the future, however only one will be allowed to execute at a time (that can change in the future for non-mutating operations). UnitOperations allow different actors interacting with the same unit to focus only on the change they have requested. This is a base object that contains the common fields in all unit operations. Next: 22
  - `name` string — Identifier. The resource name (full URI of the resource) following the standard naming scheme: "projects/{project}/locations/{location}/unitOperations/{unitOperation}"
  - `errorCategory` 'UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED' | 'NOT_APPLICABLE' | 'FATAL' | 'RETRIABLE' | 'IGNORABLE' | 'STANDARD' — Optional. Output only. UnitOperationErrorCategory describe the error category.
  - `upgrade` Upgrade — Upgrade is the unit operation that upgrades a provisioned unit, which may also include the underlying resources represented by a Unit. Can only execute if the Unit is currently provisioned.
    - `inputVariables` UnitVariable[] — Optional. Set of input variables. Maximum 100. (optional)
      - `type` 'TYPE_UNSPECIFIED' | 'STRING' | 'INT' | 'BOOL' | 'STRUCT' | 'LIST' — Optional. Immutable. Name of a supported variable type. Supported types are string, int, bool.
      - `value` string — Optional. String encoded value for the variable.
      - `variable` string — Required. Immutable. Name of the variable from actuation configs.
    - `release` string — Optional. Reference to the Release object to use for the Unit. (optional).
  - `deleteTime` string, google-datetime — Output only. The timestamp when the resource was marked for deletion (deletion is an asynchronous operation).
  - `annotations` object — Optional. Annotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/user-guide/annotations
  - `conditions` UnitOperationCondition[] — Optional. Output only. A set of conditions which indicate the various conditions this resource can have.
    - `status` 'STATUS_UNSPECIFIED' | 'STATUS_UNKNOWN' | 'STATUS_TRUE' | 'STATUS_FALSE' — Required. Status of the condition.
    - `type` 'TYPE_UNSPECIFIED' | 'TYPE_SCHEDULED' | 'TYPE_RUNNING' | 'TYPE_SUCCEEDED' | 'TYPE_CANCELLED' | 'TYPE_APP_CREATED' | 'TYPE_APP_COMPONENTS_REGISTERED' | 'TYPE_WORKLOAD_SUCCEEDED' — Required. Type of the condition.
    - `lastTransitionTime` string, google-datetime — Required. Last time the condition transited from one status to another.
    - `message` string — Required. Human readable message indicating details about the last transition.
    - `reason` string — Required. Brief reason for the condition's last transition.
  - `deprovision` Deprovision — Deprovision is the unit operation that deprovision the underlying resources represented by a Unit. Can only execute if the Unit is currently provisioned.
  - `provision` Provision — Provision is the unit operation that provision the underlying resources represented by a Unit. Can only execute if the Unit is not currently provisioned.
    - `inputVariables` UnitVariable[] — Optional. Set of input variables. Maximum 100. (optional)
      - `type` 'TYPE_UNSPECIFIED' | 'STRING' | 'INT' | 'BOOL' | 'STRUCT' | 'LIST' — Optional. Immutable. Name of a supported variable type. Supported types are string, int, bool.
      - `value` string — Optional. String encoded value for the variable.
      - `variable` string — Required. Immutable. Name of the variable from actuation configs.
    - `release` string — Optional. Reference to the Release object to use for the Unit. (optional).
  - `engineState` string — Optional. Output only. The engine state for on-going deployment engine operation(s). This field is opaque for external usage.
  - `rollout` string — Optional. Specifies which rollout created this Unit Operation. This cannot be modified and is used for filtering purposes only. If a dependent unit and unit operation are created as part of another unit operation, they will use the same rolloutId.
  - `state` 'UNIT_OPERATION_STATE_UNKNOWN' | 'UNIT_OPERATION_STATE_PENDING' | 'UNIT_OPERATION_STATE_SCHEDULED' | 'UNIT_OPERATION_STATE_RUNNING' | 'UNIT_OPERATION_STATE_SUCCEEDED' | 'UNIT_OPERATION_STATE_FAILED' | 'UNIT_OPERATION_STATE_CANCELLED' — Optional. Output only. UnitOperationState describes the current state of the unit operation.
  - `cancel` boolean — Optional. When true, attempt to cancel the operation. Cancellation may fail if the operation is already executing. (Optional)
  - `etag` string — Output only. An opaque value that uniquely identifies a version or generation of a resource. It can be used to confirm that the client and server agree on the ordering of a resource being written.
  - `createTime` string, google-datetime — Output only. The timestamp when the resource was created.
  - `updateTime` string, google-datetime — Output only. The timestamp when the resource was last updated. Any change to the resource made by users must refresh this value. Changes to a resource made by the service should refresh this value.
  - `schedule` Schedule — A time specification to schedule the maintenance.
    - `startTime` string, google-datetime — Optional. Start of operation. If not set, will be set to the start of the next window. (optional)
  - `uid` string — Output only. The unique identifier of the resource. UID is unique in the time and space for this resource within the scope of the service. It is typically generated by the server on successful creation of a resource and must not be changed. UID is used to uniquely identify resources with resource name reuses. This should be a UUID4.
  - `flagUpdate` FlagUpdate — FlagUpdate is a UnitOperation that pushes new flag values to Units.
    - `flagRelease` string — Required. Flag release being applied by UnitOperation.
  - `unit` string — Required. Immutable. The Unit a given UnitOperation will act upon.
  - `labels` object — Optional. The labels on the resource, which can be used for categorization. similar to Kubernetes resource labels.
  - `parentUnitOperation` string — Optional. Reference to parent resource: UnitOperation. If an operation needs to create other operations as part of its workflow, each of the child operations should have this field set to the parent. This can be used for tracing. (Optional)

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/saasservicemgmt.md) · [All operations](https://skmtc.net/google/apis/saasservicemgmt/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/saasservicemgmt/versions/f94de4124ae2/schema)
