---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/insights:writeInsight"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/insights:writeInsight"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/insights:writeInsight

`POST /v1/projects/{projectsId}/locations/{locationsId}/insights:writeInsight`

## Request

- Base URL: `https://workloadmanager.googleapis.com`
- URL: `https://workloadmanager.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/insights:writeInsight`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Write the data insights to workload manager data warehouse.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- WriteInsightRequest: Request for sending the data insights.
  - `agentVersion` string: Optional. The agent version collected this data point.
  - `insight` Insight: A presentation of host resource usage where the workload runs.
    - `agentStatus` AgentStatus: The schema of agent status data.
      - `agentName` string: Output only. The name of the agent.
      - `availableVersion` string: Output only. The available version of the agent in artifact registry.
      - `cloudApiAccessFullScopesGranted` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the agent has full access to Cloud APIs.
      - `configurationErrorMessage` string: Output only. The error message for the agent configuration if invalid.
      - `configurationFilePath` string: Output only. The path to the agent configuration file.
      - `configurationValid` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the agent configuration is valid.
      - `installedVersion` string: Output only. The installed version of the agent on the host.
      - `instanceUri` string: Output only. The URI of the instance. Format: projects//zones//instances/
      - `kernelVersion` SapDiscoveryResourceInstancePropertiesKernelVersion: KernelVersion encapsulates the kernel version data for the system.
        - `distroKernel` SapDiscoveryResourceInstancePropertiesKernelVersionVersion: Version is reported as Major.Minor.Build.Patch.
          - `build` integer: Optional. The build version number.
          - `major` integer: Optional. The major version number.
          - `minor` integer: Optional. The minor version number.
          - `patch` integer: Optional. The patch version number.
          - `remainder` string: Optional. A catch-all for any unparsed version components. This is in case the number of points in the version string exceeds the expected count of 4.
        - `osKernel` SapDiscoveryResourceInstancePropertiesKernelVersionVersion: Version is reported as Major.Minor.Build.Patch.
          - `build` integer: Optional. The build version number.
          - `major` integer: Optional. The major version number.
          - `minor` integer: Optional. The minor version number.
          - `patch` integer: Optional. The patch version number.
          - `remainder` string: Optional. A catch-all for any unparsed version components. This is in case the number of points in the version string exceeds the expected count of 4.
        - `rawString` string: Optional. Raw string of the kernel version.
      - `references` AgentStatusReference[]: Output only. Optional references to public documentation.
        - `name` string: Output only. The name of the reference.
        - `url` string: Output only. The URL of the reference.
      - `services` AgentStatusServiceStatus[]: Output only. The services (process metrics, host metrics, etc.).
        - `configValues` AgentStatusConfigValue[]: Output only. The configuration values for the service.
          - `isDefault` boolean: Output only. Whether the configuration value is the default value or overridden.
          - `name` string: Output only. The name of the configuration value.
          - `value` string: Output only. The value of the configuration value.
        - `errorMessage` string: Output only. The error message for the service if it is not fully functional.
        - `fullyFunctional` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the service is fully functional (all checks passed).
        - `iamPermissions` AgentStatusIAMPermission[]: Output only. The permissions required for the service.
          - `granted` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the permission is granted.
          - `name` string: Output only. The name of the permission.
        - `name` string: Output only. The name of the service.
        - `state` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. The state of the service (enabled or disabled in the configuration).
        - `unspecifiedStateMessage` string: Output only. The message to display when the service state is unspecified.
      - `systemdServiceEnabled` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the agent service is enabled in systemd.
      - `systemdServiceRunning` 'UNSPECIFIED_STATE' | 'SUCCESS_STATE' | 'FAILURE_STATE' | 'ERROR_STATE': Output only. Whether the agent service is running in systemd.
    - `instanceId` string: Optional. The instance id where the insight is generated from
    - `openShiftValidation` OpenShiftValidation: A presentation of OpenShift workload insight. The schema of OpenShift workloads validation related data.
      - `clusterId` string: Required. The OpenShift cluster ID (e.g. 8371bb05-7cac-4d38-82c0-0f58c4f6f936).
      - `validationDetails` object: Required. The validation details of the OpenShift cluster in JSON format.
    - `sapDiscovery` SapDiscovery: The schema of SAP system discovery data.
      - `applicationLayer` SapDiscoveryComponent: Message describing the system component.
        - `applicationProperties` SapDiscoveryComponentApplicationProperties: A set of properties describing an SAP Application layer.
          - `abap` boolean: Optional. Deprecated: ApplicationType now tells you whether this is ABAP or Java.
          - `appInstanceNumber` string: Optional. Instance number of the SAP application instance.
          - `applicationType` 'APPLICATION_TYPE_UNSPECIFIED' | 'NETWEAVER' | 'NETWEAVER_ABAP' | 'NETWEAVER_JAVA': Required. Type of the application. Netweaver, etc.
          - `ascsInstanceNumber` string: Optional. Instance number of the ASCS instance.
          - `ascsUri` string: Optional. Resource URI of the recognized ASCS host of the application.
          - `ersInstanceNumber` string: Optional. Instance number of the ERS instance.
          - `kernelVersion` string: Optional. Kernel version for Netweaver running in the system.
          - `nfsUri` string: Optional. Resource URI of the recognized shared NFS of the application. May be empty if the application server has only a single node.
        - `databaseProperties` SapDiscoveryComponentDatabaseProperties: A set of properties describing an SAP Database layer.
          - `databaseSid` string: Optional. SID of the system database.
          - `databaseType` 'DATABASE_TYPE_UNSPECIFIED' | 'HANA' | 'MAX_DB' | 'DB2' | 'ORACLE' | 'SQLSERVER' | 'ASE': Required. Type of the database. HANA, DB2, etc.
          - `databaseVersion` string: Optional. The version of the database software running in the system.
          - `instanceNumber` string: Optional. Instance number of the SAP instance.
          - `landscapeId` string: Optional. Landscape ID from the HANA nameserver.
          - `primaryInstanceUri` string: Required. URI of the recognized primary instance of the database.
          - `sharedNfsUri` string: Optional. URI of the recognized shared NFS of the database. May be empty if the database has only a single node.
        - `haHosts` string[]: Optional. A list of host URIs that are part of the HA configuration if present. An empty list indicates the component is not configured for HA.
        - `hostProject` string: Required. Pantheon Project in which the resources reside.
        - `region` string: Optional. The region this component's resources are primarily located in.
        - `replicationSites` SapDiscoveryComponentReplicationSite[]: Optional. A list of replication sites used in Disaster Recovery (DR) configurations.
          - `component` SapDiscoveryComponent (recursive)
          - `sourceSite` string: Optional. The name of the source site from which this one replicates.
        - `resources` SapDiscoveryResource[]: Optional. The resources in a component.
          - `instanceProperties` SapDiscoveryResourceInstanceProperties: A set of properties only present for an instance type resource
            - `appInstances` SapDiscoveryResourceInstancePropertiesAppInstance[]: Optional. App server instances on the host
              - …
            - `clusterInstances` string[]: Optional. A list of instance URIs that are part of a cluster with this one.
            - `diskMounts` SapDiscoveryResourceInstancePropertiesDiskMount[]: Optional. Disk mounts on the instance.
              - …
            - `instanceNumber` string, int64: Optional. The VM's instance number.
            - `instanceRole` 'INSTANCE_ROLE_UNSPECIFIED' | 'INSTANCE_ROLE_ASCS' | 'INSTANCE_ROLE_ERS' | 'INSTANCE_ROLE_APP_SERVER' | 'INSTANCE_ROLE_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS' | 'INSTANCE_ROLE_ASCS_APP_SERVER' | 'INSTANCE_ROLE_ASCS_DATABASE' | 'INSTANCE_ROLE_ERS_APP_SERVER' | 'INSTANCE_ROLE_ERS_DATABASE' | 'INSTANCE_ROLE_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS_APP_SERVER' | 'INSTANCE_ROLE_ASCS_ERS_DATABASE' | 'INSTANCE_ROLE_ASCS_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ERS_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS_APP_SERVER_DATABASE': Optional. Bitmask of instance role, a resource may have multiple roles at once.
            - `isDrSite` boolean: Optional. Instance is part of a DR site.
            - `osKernelVersion` SapDiscoveryResourceInstancePropertiesKernelVersion: KernelVersion encapsulates the kernel version data for the system.
              - …
            - `virtualHostname` string: Optional. A virtual hostname of the instance if it has one.
          - `relatedResources` string[]: Optional. A list of resource URIs related to this resource.
          - `resourceKind` 'RESOURCE_KIND_UNSPECIFIED' | 'RESOURCE_KIND_INSTANCE' | 'RESOURCE_KIND_DISK' | 'RESOURCE_KIND_ADDRESS' | 'RESOURCE_KIND_FILESTORE' | 'RESOURCE_KIND_HEALTH_CHECK' | 'RESOURCE_KIND_FORWARDING_RULE' | 'RESOURCE_KIND_BACKEND_SERVICE' | 'RESOURCE_KIND_SUBNETWORK' | 'RESOURCE_KIND_NETWORK' | 'RESOURCE_KIND_PUBLIC_ADDRESS' | 'RESOURCE_KIND_INSTANCE_GROUP': Required. ComputeInstance, ComputeDisk, VPC, Bare Metal server, etc.
          - `resourceType` 'RESOURCE_TYPE_UNSPECIFIED' | 'RESOURCE_TYPE_COMPUTE' | 'RESOURCE_TYPE_STORAGE' | 'RESOURCE_TYPE_NETWORK': Required. The type of this resource.
          - `resourceUri` string: Required. URI of the resource, includes project, location, and name.
          - `updateTime` string, google-datetime: Required. Unix timestamp of when this resource last had its discovery data updated.
        - `sid` string: Optional. The SAP identifier, used by the SAP software and helps differentiate systems for customers.
        - `topologyType` 'TOPOLOGY_TYPE_UNSPECIFIED' | 'TOPOLOGY_SCALE_UP' | 'TOPOLOGY_SCALE_OUT': Optional. The detected topology of the component.
      - `databaseLayer` SapDiscoveryComponent: Message describing the system component.
        - `applicationProperties` SapDiscoveryComponentApplicationProperties: A set of properties describing an SAP Application layer.
          - `abap` boolean: Optional. Deprecated: ApplicationType now tells you whether this is ABAP or Java.
          - `appInstanceNumber` string: Optional. Instance number of the SAP application instance.
          - `applicationType` 'APPLICATION_TYPE_UNSPECIFIED' | 'NETWEAVER' | 'NETWEAVER_ABAP' | 'NETWEAVER_JAVA': Required. Type of the application. Netweaver, etc.
          - `ascsInstanceNumber` string: Optional. Instance number of the ASCS instance.
          - `ascsUri` string: Optional. Resource URI of the recognized ASCS host of the application.
          - `ersInstanceNumber` string: Optional. Instance number of the ERS instance.
          - `kernelVersion` string: Optional. Kernel version for Netweaver running in the system.
          - `nfsUri` string: Optional. Resource URI of the recognized shared NFS of the application. May be empty if the application server has only a single node.
        - `databaseProperties` SapDiscoveryComponentDatabaseProperties: A set of properties describing an SAP Database layer.
          - `databaseSid` string: Optional. SID of the system database.
          - `databaseType` 'DATABASE_TYPE_UNSPECIFIED' | 'HANA' | 'MAX_DB' | 'DB2' | 'ORACLE' | 'SQLSERVER' | 'ASE': Required. Type of the database. HANA, DB2, etc.
          - `databaseVersion` string: Optional. The version of the database software running in the system.
          - `instanceNumber` string: Optional. Instance number of the SAP instance.
          - `landscapeId` string: Optional. Landscape ID from the HANA nameserver.
          - `primaryInstanceUri` string: Required. URI of the recognized primary instance of the database.
          - `sharedNfsUri` string: Optional. URI of the recognized shared NFS of the database. May be empty if the database has only a single node.
        - `haHosts` string[]: Optional. A list of host URIs that are part of the HA configuration if present. An empty list indicates the component is not configured for HA.
        - `hostProject` string: Required. Pantheon Project in which the resources reside.
        - `region` string: Optional. The region this component's resources are primarily located in.
        - `replicationSites` SapDiscoveryComponentReplicationSite[]: Optional. A list of replication sites used in Disaster Recovery (DR) configurations.
          - `component` SapDiscoveryComponent (recursive)
          - `sourceSite` string: Optional. The name of the source site from which this one replicates.
        - `resources` SapDiscoveryResource[]: Optional. The resources in a component.
          - `instanceProperties` SapDiscoveryResourceInstanceProperties: A set of properties only present for an instance type resource
            - `appInstances` SapDiscoveryResourceInstancePropertiesAppInstance[]: Optional. App server instances on the host
              - …
            - `clusterInstances` string[]: Optional. A list of instance URIs that are part of a cluster with this one.
            - `diskMounts` SapDiscoveryResourceInstancePropertiesDiskMount[]: Optional. Disk mounts on the instance.
              - …
            - `instanceNumber` string, int64: Optional. The VM's instance number.
            - `instanceRole` 'INSTANCE_ROLE_UNSPECIFIED' | 'INSTANCE_ROLE_ASCS' | 'INSTANCE_ROLE_ERS' | 'INSTANCE_ROLE_APP_SERVER' | 'INSTANCE_ROLE_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS' | 'INSTANCE_ROLE_ASCS_APP_SERVER' | 'INSTANCE_ROLE_ASCS_DATABASE' | 'INSTANCE_ROLE_ERS_APP_SERVER' | 'INSTANCE_ROLE_ERS_DATABASE' | 'INSTANCE_ROLE_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS_APP_SERVER' | 'INSTANCE_ROLE_ASCS_ERS_DATABASE' | 'INSTANCE_ROLE_ASCS_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ERS_APP_SERVER_DATABASE' | 'INSTANCE_ROLE_ASCS_ERS_APP_SERVER_DATABASE': Optional. Bitmask of instance role, a resource may have multiple roles at once.
            - `isDrSite` boolean: Optional. Instance is part of a DR site.
            - `osKernelVersion` SapDiscoveryResourceInstancePropertiesKernelVersion: KernelVersion encapsulates the kernel version data for the system.
              - …
            - `virtualHostname` string: Optional. A virtual hostname of the instance if it has one.
          - `relatedResources` string[]: Optional. A list of resource URIs related to this resource.
          - `resourceKind` 'RESOURCE_KIND_UNSPECIFIED' | 'RESOURCE_KIND_INSTANCE' | 'RESOURCE_KIND_DISK' | 'RESOURCE_KIND_ADDRESS' | 'RESOURCE_KIND_FILESTORE' | 'RESOURCE_KIND_HEALTH_CHECK' | 'RESOURCE_KIND_FORWARDING_RULE' | 'RESOURCE_KIND_BACKEND_SERVICE' | 'RESOURCE_KIND_SUBNETWORK' | 'RESOURCE_KIND_NETWORK' | 'RESOURCE_KIND_PUBLIC_ADDRESS' | 'RESOURCE_KIND_INSTANCE_GROUP': Required. ComputeInstance, ComputeDisk, VPC, Bare Metal server, etc.
          - `resourceType` 'RESOURCE_TYPE_UNSPECIFIED' | 'RESOURCE_TYPE_COMPUTE' | 'RESOURCE_TYPE_STORAGE' | 'RESOURCE_TYPE_NETWORK': Required. The type of this resource.
          - `resourceUri` string: Required. URI of the resource, includes project, location, and name.
          - `updateTime` string, google-datetime: Required. Unix timestamp of when this resource last had its discovery data updated.
        - `sid` string: Optional. The SAP identifier, used by the SAP software and helps differentiate systems for customers.
        - `topologyType` 'TOPOLOGY_TYPE_UNSPECIFIED' | 'TOPOLOGY_SCALE_UP' | 'TOPOLOGY_SCALE_OUT': Optional. The detected topology of the component.
      - `metadata` SapDiscoveryMetadata: Message describing SAP discovery system metadata
        - `customerRegion` string: Optional. Customer region string for customer's use. Does not represent GCP region.
        - `definedSystem` string: Optional. Customer defined, something like "E-commerce pre prod"
        - `environmentType` string: Optional. Should be "prod", "QA", "dev", "staging", etc.
        - `sapProduct` string: Optional. This SAP product name
      - `projectNumber` string: Optional. The GCP project number that this SapSystem belongs to.
      - `systemId` string: Output only. A combination of database SID, database instance URI and tenant DB name to make a unique identifier per-system.
      - `updateTime` string, google-datetime: Required. Unix timestamp this system has been updated last.
      - `useDrReconciliation` boolean: Optional. Whether to use DR reconciliation or not.
      - `workloadProperties` SapDiscoveryWorkloadProperties: A set of properties describing an SAP workload.
        - `productVersions` SapDiscoveryWorkloadPropertiesProductVersion[]: Optional. List of SAP Products and their versions running on the system.
          - `name` string: Optional. Name of the product.
          - `version` string: Optional. Version of the product.
        - `softwareComponentVersions` SapDiscoveryWorkloadPropertiesSoftwareComponentProperties[]: Optional. A list of SAP software components and their versions running on the system.
          - `extVersion` string: Optional. The component's minor version.
          - `name` string: Optional. Name of the component.
          - `type` string: Optional. The component's type.
          - `version` string: Optional. The component's major version.
    - `sapValidation` SapValidation: A presentation of SAP workload insight. The schema of SAP workloads validation related data.
      - `projectId` string: Required. The project_id of the cloud project that the Insight data comes from.
      - `validationDetails` SapValidationValidationDetail[]: Optional. A list of SAP validation metrics data.
        - `details` object: Optional. The pairs of metrics data: field name & field value.
        - `isPresent` boolean: Optional. Was there a SAP system detected for this validation type.
        - `sapValidationType` 'SAP_VALIDATION_TYPE_UNSPECIFIED' | 'SYSTEM' | 'COROSYNC' | 'PACEMAKER' | 'HANA' | 'NETWEAVER' | 'HANA_SECURITY' | 'CUSTOM': Optional. The SAP system that the validation data is from.
      - `zone` string: Optional. The zone of the instance that the Insight data comes from.
    - `sentTime` string, google-datetime: Output only. [Output only] Create time stamp
    - `sqlserverValidation` SqlserverValidation: A presentation of SQLServer workload insight. The schema of SqlServer workloads validation related data.
      - `agentVersion` string: Optional. The agent version collected this data point
      - `instance` string: Required. The instance_name of the instance that the Insight data comes from. According to https://linter.aip.dev/122/name-suffix: field names should not use the _name suffix unless the field would be ambiguous without it.
      - `projectId` string: Required. The project_id of the cloud project that the Insight data comes from.
      - `validationDetails` SqlserverValidationValidationDetail[]: Optional. A list of SqlServer validation metrics data.
        - `details` SqlserverValidationDetails[]: Required. Details wraps map that represents collected data names and values.
          - `fields` object: Required. Collected data is in format.
        - `type` 'SQLSERVER_VALIDATION_TYPE_UNSPECIFIED' | 'OS' | 'DB_LOG_DISK_SEPARATION' | 'DB_MAX_PARALLELISM' | 'DB_CXPACKET_WAITS' | 'DB_TRANSACTION_LOG_HANDLING' | 'DB_VIRTUAL_LOG_FILE_COUNT' | 'DB_BUFFER_POOL_EXTENSION' | 'DB_MAX_SERVER_MEMORY' | 'INSTANCE_METRICS' | 'DB_INDEX_FRAGMENTATION' | 'DB_TABLE_INDEX_COMPRESSION' | 'DB_BACKUP_POLICY': Optional. The Sqlserver system that the validation data is from.
    - `torsoValidation` TorsoValidation: The schema of torso workload validation data.
      - `agentVersion` string: Required. agent_version lists the version of the agent that collected this data.
      - `instanceName` string: Optional. instance_name lists the human readable name of the instance that the data comes from.
      - `projectId` string: Required. project_id lists the human readable cloud project that the data comes from.
      - `validationDetails` object: Required. validation_details contains the pairs of validation data: field name & field value.
      - `workloadType` 'WORKLOAD_TYPE_UNSPECIFIED' | 'MYSQL' | 'ORACLE' | 'REDIS': Required. workload_type specifies the type of torso workload.
  - `requestId` 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).

## Response `200`

Successful response

- WriteInsightResponse: The response for write insights request.

---

[API](https://skmtc.dev/google/apis/workloadmanager.md) - [All operations](https://skmtc.dev/google/apis/workloadmanager/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/workloadmanager/revisions/5d93d5206535?raw)
