---
title: "PATCH /v2/{+name}"
method: PATCH
path: "/v2/{+name}"
tags: ["projects"]
---

# PATCH /v2/{+name}

`PATCH /v2/{+name}`

UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. _Direct use of this API is discouraged, please use a [supported profiler agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) instead for profile collection._

## Path parameters

- `name` string, required

## Query parameters

- `updateMask` string

## Request body

- Profile — Profile resource.
  - `labels` object — Input only. Labels associated to this specific profile. These labels will get merged with the deployment labels for the final data set. See documentation on deployment labels for validation rules and limits.
  - `startTime` string, google-datetime — Output only. Start time for the profile. This output is only present in response from the ListProfiles method.
  - `profileType` 'PROFILE_TYPE_UNSPECIFIED' | 'CPU' | 'WALL' | 'HEAP' | 'THREADS' | 'CONTENTION' | 'PEAK_HEAP' | 'HEAP_ALLOC' — Type of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server.
  - `profileBytes` string, byte — Input only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto.
  - `duration` string, google-duration — Duration of the profiling session. Input (for the offline mode) or output (for the online mode). The field represents requested profiling duration. It may slightly differ from the effective profiling duration, which is recorded in the profile data, in case the profiling can't be stopped immediately (e.g. in case stopping the profiling is handled asynchronously).
  - `name` string — Output only. Opaque, server-assigned, unique ID for this profile.
  - `deployment` Deployment — Deployment contains the deployment identification information.
    - `target` string — Target is the service name used to group related deployments: * Service name for App Engine Flex / Standard. * Cluster and container name for GKE. * User-specified string for direct Compute Engine profiling (e.g. Java). * Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
    - `projectId` string — Project ID is the ID of a cloud project. Validation regex: `^a-z{4,61}[a-z0-9]$`.
    - `labels` object — Labels identify the deployment within the user universe and same target. Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Value for an individual label must be <= 512 bytes, the total size of all label names and values must be <= 1024 bytes. Label named "language" can be used to record the programming language of the profiled deployment. The standard choices for the value include "java", "go", "python", "ruby", "nodejs", "php", "dotnet". For deployments running on Google Cloud Platform, "zone" or "region" label should be present describing the deployment location. An example of a zone is "us-central1-a", an example of a region is "us-central1" or "us-central".

## Response `200`

Successful response

---

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