# Environment

An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. It exposes all the necessary tools (open source, 3rd party, or custom tools) along with their connection interfaces including external node port and the container ports. You can also specify a standard, distributed, or inference workload architecture for the environment. An environment is a mandatory building block for the creation of a workload. For more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).

## List environment assets.

> Use to retrieve a list of environment assets.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Environment","description":"An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. \nIt exposes all the necessary tools (open source, 3rd party, or custom tools) along \nwith their connection interfaces including external node port and the container ports.\nYou can also specify a standard, distributed, or inference workload architecture for the environment.\nAn environment is a mandatory building block for the creation of a workload.\nFor more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"AssetNameFilter":{"name":"name","in":"query","required":false,"description":"Filter results by name.","schema":{"type":"string"}},"AssetScopeFilter":{"name":"scope","in":"query","required":false,"description":"Filter results by scope.","schema":{"type":"string"}},"AssetProjectFilter":{"name":"projectId","in":"query","required":false,"description":"Filter results by project id. If scope filter is project, only assets from the specific project will be included in the response. Otherwise, the response will include project, department, cluster, tenant and system assets.","schema":{"type":"integer","format":"int32"}},"AssetDepartmentFilter":{"name":"departmentId","in":"query","description":"Filter results by department id. If scope filter is department, only assets from the specific department will be included in the response. Otherwise, the response will include department, cluster, tenant and system assets.","required":false,"schema":{"type":"string"}},"AssetClusterFilter":{"name":"clusterId","in":"query","description":"Filter results by Universally Unique Identifier (UUID) of the cluster. If scope filter is cluster, only assets from the specific cluster will be included in the response. Otherwise, the response will include cluster, tenant and system assets.","required":false,"schema":{"type":"string","format":"uuid"}},"IncludeUsageInfo":{"name":"usageInfo","in":"query","required":false,"description":"Whether the query should include asset usage information as part of the response.","schema":{"type":"boolean"}},"ComplyToProject":{"name":"complyToProject","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given project, as part of the response. To check compliance, you need to provide both project id and workload type.","schema":{"type":"integer","format":"int32"}},"ComplyToWorkloadType":{"name":"complyToWorkloadType","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given workload type, as part of the response. To check compliance, you need to provide both project id and workload type.","schema":{"type":"string","enum":["Workspace","Training","Distributed","Inference"]}},"DistributedFrameworkQuery":{"name":"distributedFramework","in":"query","required":false,"description":"Filter results to workload of type distributed and distributedFramework.","schema":{"type":"string"},"allowReserved":true},"IsDistributedQuery":{"name":"isDistributed","in":"query","required":false,"description":"Filter results to workload of type distributed.","schema":{"type":"boolean"},"allowReserved":true},"IsTrainingQuery":{"name":"isTraining","in":"query","required":false,"description":"Filter results to workload of type training.","schema":{"type":"boolean"},"allowReserved":true},"IsWorkspaceQuery":{"name":"isWorkspace","in":"query","required":false,"description":"Filter results to workload of type workspace.","schema":{"type":"boolean"},"allowReserved":true},"IsInferenceQuery":{"name":"isInference","in":"query","required":false,"description":"Filter results to workload of type inference.","schema":{"type":"boolean"},"allowReserved":true},"ComplyToReplicaType":{"name":"complyToReplicaType","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given replica type, as part of the response. To check compliance, you need to provide both project id and workload type. For distributed, replica type should be provided as well.","schema":{"type":"string","enum":["Worker","Master"]}},"IncludeStatus":{"name":"statusInfo","in":"query","required":false,"description":"Whether the query should include asset status information as part of the response.","schema":{"type":"boolean"}},"includeDescendants":{"name":"includeDescendants","in":"query","required":false,"description":"Whether the query should include asset from all nested layers within the specified entity","schema":{"type":"boolean"}}},"schemas":{"EnvironmentListResponse":{"required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentAsset"}}}},"EnvironmentAsset":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetMeta"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"},"usedBy":{"$ref":"#/components/schemas/AssetUsageInfo"},"usageTimes":{"$ref":"#/components/schemas/UsageTimesInfo"},"compliance":{"$ref":"#/components/schemas/ComplianceInfo"},"status":{"$ref":"#/components/schemas/AssetClusterStatusInfo"}}},"AssetMeta":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"},{"$ref":"#/components/schemas/AssetCreationFields"},{"$ref":"#/components/schemas/AssetReadOnlyFields"}]},"AssetUpdatableFields":{"required":["name"],"properties":{"name":{"$ref":"#/components/schemas/AssetName"},"description":{"$ref":"#/components/schemas/AssetDescription"}}},"AssetName":{"description":"The name of the asset.","type":"string","minLength":1},"AssetDescription":{"description":"The description of the asset.","type":"string","minLength":1,"maxLength":250,"nullable":true},"AssetCreationFields":{"type":"object","required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/Scope"},"clusterId":{"$ref":"#/components/schemas/ClusterIdOptional"},"departmentId":{"description":"The id of the department. Must be specified for department scoped assets.","type":"string","nullable":true,"minLength":1},"projectId":{"description":"The id of the project. Must be specified for project scoped assets.","type":"integer","format":"int32","nullable":true},"autoDelete":{"description":"The asset will be deleted automatically. This is intended for internal use.","type":"boolean","nullable":true,"default":false},"workloadSupportedTypes":{"$ref":"#/components/schemas/WorkloadSupportedTypes"}}},"Scope":{"description":"The scope in which an asset can be used. The highest scope, system, is intended for internal purposes only.","type":"string","minLength":1,"enum":["system","tenant","cluster","department","project"]},"ClusterIdOptional":{"description":"The id of the cluster.","type":"string","format":"uuid","minLength":1,"nullable":true},"WorkloadSupportedTypes":{"properties":{"inference":{"description":"Is inference a supported workload type.","type":"boolean","nullable":true},"workspace":{"description":"Is workspace a supported workload type.","type":"boolean","nullable":true},"training":{"description":"Is training a supported workload type.","type":"boolean","nullable":true},"distributed":{"description":"Is distributed a supported workload type.","type":"boolean","nullable":true},"distFramework":{"description":"The distributed training framework used in the workload.","type":"string","enum":["MPI","PyTorch","TF","XGBoost"],"nullable":true}},"nullable":true,"type":"object"},"AssetReadOnlyFields":{"required":["id","kind","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"kind":{"$ref":"#/components/schemas/AssetKind"},"tenantId":{"description":"The id of the tenant.","type":"integer","format":"int32","nullable":true},"createdBy":{"description":"The user who created the asset.","type":"string","minLength":1},"createdAt":{"description":"The time at which the asset were created","type":"string","minLength":1,"format":"date-time"},"updatedBy":{"description":"The user who updated the asset.","type":"string","minLength":1},"updatedAt":{"description":"The time at which the asset has been updated","type":"string","minLength":1,"format":"date-time"},"deletedAt":{"description":"Deletion time of the asset (relevant for assets that sync to the cluster)","type":"string","minLength":1,"format":"date-time"},"deletedBy":{"description":"The user who deleted the asset","type":"string","minLength":1},"projectName":{"description":"The name of the project that the asset is associated with, for project scoped assets.","type":"string","minLength":1,"nullable":true},"updateCount":{"$ref":"#/components/schemas/UpdateCount"}},"type":"object"},"AssetId":{"description":"Unique identifier of the asset.","type":"string","format":"uuid","minLength":1},"AssetKind":{"description":"The kind of the asset.","type":"string","minLength":1,"enum":["compute","environment","accessKey","dockerRegistry","password","genericSecret","registry","s3","git","nfs","pvc","hostPath","workload-template","model","config-map","secret-volume","data-volume"]},"UpdateCount":{"description":"the value of an update counter of a data in the system.","type":"integer","format":"int64"},"EnvironmentAssetSpec":{"allOf":[{"$ref":"#/components/schemas/OverridableSpecFields"},{"$ref":"#/components/schemas/NonOverridableSpecFields"}]},"OverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerOverridable"},{"$ref":"#/components/schemas/CommonSecurityOverridable"},{"$ref":"#/components/schemas/EnvironmentVariablesAssetField"}]},"ContainerOverridable":{"description":"Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"command":{"description":"A command to the server as the entry point of the container running the workload.","type":"string","minLength":1,"nullable":true},"args":{"description":"Arguments to the command that the container running the workload executes.","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"CommonSecurityOverridable":{"description":"Security overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"runAsUid":{"description":"The user id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsUid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"runAsGid":{"description":"The group id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsGid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"supplementalGroups":{"description":"Comma separated list of groups that the user running the container belongs to, in addition to the group indicated by runAsGid. Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled. Using an empty string implies reverting the supplementary groups of the image.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablesAssetField":{"properties":{"environmentVariables":{"$ref":"#/components/schemas/EnvironmentVariablesOfAsset"}},"nullable":true,"type":"object"},"EnvironmentVariablesOfAsset":{"description":"Set of environment variables to populate into the container running the workspace.","type":"array","items":{"$ref":"#/components/schemas/EnvironmentVariableOfAsset"},"nullable":true},"EnvironmentVariableOfAsset":{"description":"Details of an environment variable which is populated into the container.","properties":{"name":{"description":"The name of the environment variable. (mandatory)","type":"string","minLength":1,"nullable":true},"value":{"description":"The value of the environment variable. (mutually exclusive with credential, configMap and podFieldRef)","type":"string","nullable":true},"credential":{"$ref":"#/components/schemas/EnvironmentVariableCredential"},"configMap":{"$ref":"#/components/schemas/EnvironmentVariableConfigMap"},"podFieldRef":{"$ref":"#/components/schemas/EnvironmentVariablePodFieldReference"},"exclude":{"description":"Use 'true' in case the environment variable is defined in defaults of the policy, and you wish to exclude it from the workload.","type":"boolean","nullable":true},"description":{"description":"Description of the environment variable.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableCredential":{"description":"Details of the secret and key use to populate the environment variable. (mutually exclusive with value)","properties":{"assetId":{"description":"Unique identifier of the asset. (mandatory)","type":"string","minLength":1,"format":"uuid","nullable":true},"key":{"description":"The key in the secret resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableConfigMap":{"description":"Details of the configMap and key use to populate the environment variable","properties":{"name":{"description":"The name of the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true},"key":{"description":"The key in the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablePodFieldReference":{"description":"Details of the field-reference and key use to populate the environment variable","properties":{"path":{"description":"The field path resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"NonOverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerNonOverridable"},{"$ref":"#/components/schemas/CommonSecurityNonOverridable"},{"$ref":"#/components/schemas/ContainerNonInferenceNonOverridable"},{"$ref":"#/components/schemas/NonInferenceSecurityNonOverridable"},{"properties":{"connections":{"description":"List of connections that either expose ports from the container (each port is associated with a tool that the container runs), or URL's to be used for connecting to an external tool that is related to the action of the container (such as Weights & Biases).","type":"array","items":{"$ref":"#/components/schemas/Connection"}},"overrideUidGidInWorkspace":{"description":"Allow specifying uid/gid as part of create workspace. This is relevant only for custom uigGidSource.","type":"boolean","default":false}}}]},"ContainerNonOverridable":{"description":"Container non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"image":{"description":"Docker image name. For more information, see [Images](https://kubernetes.io/docs/concepts/containers/images). The image name is mandatory for creating a workload.","type":"string","minLength":1,"nullable":true},"imagePullPolicy":{"$ref":"#/components/schemas/ImagePullPolicy"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime default will be used. This may be configured in the container image.","type":"string","minLength":1,"nullable":true},"createHomeDir":{"description":"When set to `true`, creates a home directory for the container.","type":"boolean","nullable":true},"probes":{"$ref":"#/components/schemas/Probes"}},"nullable":true,"type":"object"},"ImagePullPolicy":{"description":"Image pull policy. Defaults to `Always` if `:latest` tag is specified, otherwise it is `IfNotPresent`.","type":"string","minLength":1,"enum":["Always","Never","IfNotPresent"],"nullable":true},"Probes":{"description":"Probes are used to determine if the container is healthy and ready to accept traffic.","type":"object","properties":{"readiness":{"$ref":"#/components/schemas/Probe"}},"nullable":true},"Probe":{"type":"object","properties":{"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness or readiness probes are initiated.","type":"integer","format":"int32","minimum":0,"nullable":true},"periodSeconds":{"description":"How often (in seconds) to perform the probe.","type":"integer","format":"int32","minimum":1,"nullable":true},"timeoutSeconds":{"description":"Number of seconds after which the probe times out.","type":"integer","format":"int32","minimum":1,"nullable":true},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed.","type":"integer","format":"int32","minimum":1,"nullable":true},"failureThreshold":{"description":"When a probe fails, the number of times to try before giving up.","type":"integer","format":"int32","minimum":1,"nullable":true},"handler":{"$ref":"#/components/schemas/ProbeHandler"}},"nullable":true},"ProbeHandler":{"description":"The action taken to determine the health of the container. (mandatory)","type":"object","properties":{"httpGet":{"description":"An action based on HTTP Get requests.","type":"object","properties":{"path":{"description":"Path to access on the HTTP server, defaults to /.","type":"string","pattern":"^(\\x2F[a-zA-Z0-9\\-_.\\x2F]*)?$","nullable":true},"port":{"description":"Number of the port to access on the container.","type":"integer","format":"int32","minimum":1,"maximum":65535,"nullable":true},"host":{"description":"Host name to connect to, defaults to the pod IP.","type":"string","format":"hostname","nullable":true},"scheme":{"$ref":"#/components/schemas/ProbeHandlerScheme"}}}},"nullable":true},"ProbeHandlerScheme":{"description":"Scheme to use for connecting to the host, defaults to HTTP.","type":"string","enum":["HTTP","HTTPS"],"nullable":true},"CommonSecurityNonOverridable":{"description":"Security non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"uidGidSource":{"$ref":"#/components/schemas/UidGidSource"},"capabilities":{"description":"Add POSIX capabilities to running containers. Defaults to the default set of capabilities granted by the container runtime.","type":"array","items":{"$ref":"#/components/schemas/Capability"},"nullable":true},"seccompProfileType":{"$ref":"#/components/schemas/SeccompProfileType"},"runAsNonRoot":{"description":"Force the container to run as a non-root user.","type":"boolean","nullable":true},"readOnlyRootFilesystem":{"description":"If true, mounts the container's root filesystem as read-only.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"UidGidSource":{"description":"Indicate the way to determine the user and group ids of the container. The options are a. `fromTheImage` - user and group ids are determined by the docker image that the container runs. this is the default option. b. `custom` - user and group ids can be specified in the environment asset and/or the workload creation request. c. `idpToken` - user and group ids are determined according to the identity provider (idp) access token. This option is intended for internal use of the environment UI form. For more information, see [User Identity](https://run-ai-docs.nvidia.com/self-hosted/2.22/admin/runai-setup/config/non-root-containers/).","type":"string","enum":["fromTheImage","fromIdpToken","custom"],"nullable":true},"Capability":{"type":"string","enum":["AUDIT_CONTROL","AUDIT_READ","AUDIT_WRITE","BLOCK_SUSPEND","CHOWN","DAC_OVERRIDE","DAC_READ_SEARCH","FOWNER","FSETID","IPC_LOCK","IPC_OWNER","KILL","LEASE","LINUX_IMMUTABLE","MAC_ADMIN","MAC_OVERRIDE","MKNOD","NET_ADMIN","NET_BIND_SERVICE","NET_BROADCAST","NET_RAW","SETGID","SETFCAP","SETPCAP","SETUID","SYS_ADMIN","SYS_BOOT","SYS_CHROOT","SYS_MODULE","SYS_NICE","SYS_PACCT","SYS_PTRACE","SYS_RAWIO","SYS_RESOURCE","SYS_TIME","SYS_TTY_CONFIG","SYSLOG","WAKE_ALARM"]},"SeccompProfileType":{"description":"Indicates which kind of seccomp profile will be applied to the container. The options are a. `RuntimeDefault` - the container runtime default profile should be used. b. `Unconfined` - no profile should be applied. c. `Localhost` is not yet supported by Run:ai.","type":"string","enum":["RuntimeDefault","Unconfined","Localhost"],"nullable":true},"ContainerNonInferenceNonOverridable":{"description":"Container non Inference overrideable fields. It adds properties which are not allowed for Inference containers","properties":{"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.","type":"boolean","nullable":true},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"NonInferenceSecurityNonOverridable":{"description":"Security related fields. When used in assets context, those are environment asset fields that cannot be override in the submit workload request.","properties":{"allowPrivilegeEscalation":{"description":"Allow the container running the workload and all launched processes to gain additional privileges after the workload starts. For more information consult the User Identity in Container guide at https://docs.run.ai/admin/runai-setup/config/non-root-containers/","type":"boolean","nullable":true},"hostIpc":{"description":"Whether to enable host IPC. Defaults to false.","type":"boolean","nullable":true},"hostNetwork":{"description":"Whether to enable host networking. Default to false.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"Connection":{"required":["name"],"properties":{"name":{"description":"A unique name of this connection. This name correlates between the connection information specified at the environment asset, to the information about the connection as specified in SpecificEnv for a specific workspace.","type":"string","minLength":1},"isExternal":{"description":"Internal tools (isExternal=false) are tools that run as part of the container. External tools (isExternal=true) run outside the container, typically in the cloud.","type":"boolean","default":false},"internalToolInfo":{"$ref":"#/components/schemas/InternalToolInfo"},"externalToolInfo":{"$ref":"#/components/schemas/ExternalToolInfo"}}},"InternalToolInfo":{"description":"Information of the internal tool.","required":["toolType","connectionType","containerPort"],"properties":{"toolType":{"$ref":"#/components/schemas/InternalToolType"},"connectionType":{"$ref":"#/components/schemas/InternalConnectionType"},"containerPort":{"description":"The port within the container that the connection exposes.","type":"integer","format":"int32","minimum":1,"maximum":65535},"nodePortInfo":{"$ref":"#/components/schemas/NodePortInfo"},"externalUrlInfo":{"$ref":"#/components/schemas/ExternalUrlInfo"},"servingPortInfo":{"$ref":"#/components/schemas/ServingPortInfo"}},"nullable":true,"type":"object"},"InternalToolType":{"description":"The type of the internal tool. Internal tool runs within the container and exposes ports associated with the tool using NodePort, LoadBalancer or ExternalUrl.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","matlab","chatbot-ui"]},"InternalConnectionType":{"description":"The type of connection that exposes the container port.","type":"string","minLength":1,"enum":["LoadBalancer","NodePort","ExternalUrl","ServingPort"]},"NodePortInfo":{"properties":{"isCustomPort":{"description":"Whether the node port is provided in the specific env of the workspace. Default is false, and in this case the node port is auto generated by the system.","type":"boolean","default":false}},"nullable":true,"type":"object"},"ExternalUrlInfo":{"properties":{"isCustomUrl":{"description":"Whether external url is provided in the specific env of the workspace. Default is false, and in this case the external url is auto generated by the system.","type":"boolean","default":false},"externalUrl":{"description":"Default value for the external url. You can override it in the specific env of the workspace. Should be specified for ExternalUrl only.","type":"string","nullable":true,"minLength":1}},"nullable":true,"type":"object"},"ServingPortInfo":{"properties":{"protocol":{"type":"string","enum":["grpc","http"],"nullable":true}},"nullable":true,"type":"object"},"ExternalToolInfo":{"description":"Information of the external tool.","required":["toolType","externalUrl"],"properties":{"toolType":{"$ref":"#/components/schemas/ExternalToolType"},"externalUrl":{"description":"The external url for connecting to the external tool. The url can include environment variables that will be replaced with the value provided for those variables when the workspace is created.","type":"string","minLength":1}},"nullable":true,"type":"object"},"ExternalToolType":{"description":"The type of external tool that is associated with the connection. External tool typically runs in the cloud and require external url for connecting to it.","type":"string","minLength":1,"enum":["wandb","comet"]},"AssetUsageInfo":{"description":"Details about resources that use the asset.","properties":{"workspaces":{"description":"workspaces that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"trainings":{"description":"trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"distributed":{"description":"distributed trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"inferences":{"description":"inferences that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"templates":{"description":"templates that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"assets":{"description":"list of other assets that use this asset. specifically, accessKeys used by s3, and passwords used by git.","$ref":"#/components/schemas/AssetsUsageRef"}},"nullable":true,"type":"object"},"WorkloadRefAndStatus":{"description":"Id, name and status of a workspace or training","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/WorkloadId1"},"name":{"$ref":"#/components/schemas/WorkloadName"},"status":{"description":"The status of the workspace or training.","type":"string","minLength":1}}},"WorkloadId1":{"description":"A unique ID of the workload.","type":"string","format":"uuid"},"WorkloadName":{"description":"The name of the workload.","type":"string","minLength":1},"AssetRef":{"description":"Reference information about an asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"}}},"AssetsUsageRef":{"description":"Reference information about usage of assets by other assets, for example datasources that uses credentials.","properties":{"environment":{"nullable":true,"type":"object","description":"environment asset.","allOf":[{"$ref":"#/components/schemas/EnvironmentAssetRef"}],"deprecated":true},"environments":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"compute":{"$ref":"#/components/schemas/AssetsUsageRefCompute","deprecated":true},"computes":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"datasources":{"type":"array","items":{"$ref":"#/components/schemas/AssetDatasourceRef"}}}},"EnvironmentAssetRef":{"description":"Reference information about environment asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"toolTypes":{"description":"the type of tools as defined in the connections of the environment asset.","type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ToolType"}}}},"ToolType":{"description":"Super set of Internal and External tool types.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","wandb","matlab","comet","chatbot-ui"]},"AssetsUsageRefCompute":{"allOf":[{"$ref":"#/components/schemas/AssetRef"}],"nullable":true,"type":"object"},"AssetDatasourceRef":{"description":"Reference information about a datasource asset.","required":["id","name","kind"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"kind":{"$ref":"#/components/schemas/AssetKind"},"overrides":{"$ref":"#/components/schemas/DataSourceOverrides","deprecated":true}}},"DataSourceOverrides":{"description":"specific fields to override in the data source.","type":"object","nullable":true,"properties":{"containerPath":{"type":"string","minLength":1,"nullable":true}}},"UsageTimesInfo":{"description":"Details about times the asset has been used by workloads, etc.","properties":{"lastUsedByWorkload":{"description":"The time at which the asset were last used by a workload of given type and project. This field requires complyToProject and complyToWorkload types flags of the API, to specify the workload type and project id.","type":"string","minLength":1,"format":"date-time","nullable":true}},"nullable":true,"type":"object"},"ComplianceInfo":{"description":"Compliance of the asset with creation of workloads in the given project.","properties":{"imposed":{"description":"Whether the asset is imposed on created workloads by the administrator.","type":"boolean"},"compliance":{"description":"Whether the asset info complies with creation of workloads in the project.","type":"boolean"},"reason":{"description":"For asset that does not comply, specify one or more reason why.","type":"array","items":{"$ref":"#/components/schemas/ComplianceInfoReason"}}},"nullable":true,"type":"object"},"ComplianceInfoReason":{"description":"A reason explaining why the asset does not comply with workloads creation for a given project.","required":["details"],"properties":{"field":{"description":"for policy related issues, includes a json path to the field in the policy for which the message applies.","nullable":true,"type":"string"},"details":{"description":"explanation of the reason for rejecting the asset.","type":"string"}}},"AssetClusterStatusInfo":{"properties":{"status":{"$ref":"#/components/schemas/AssetSyncStatusEnum"},"issues":{"$ref":"#/components/schemas/AssetClusterStatusIssues"},"message":{"type":"string"},"url":{"type":"string"}},"nullable":true,"type":"object"},"AssetSyncStatusEnum":{"type":"string","enum":["Creating","Deleting","Failed","Deletion failed","Issues found","No issues found","No status","Updating"]},"AssetClusterStatusIssues":{"type":"array","items":{"$ref":"#/components/schemas/AssetClusterStatusIssue"}},"AssetClusterStatusIssue":{"type":"object","required":["scopeId","scopeType","issue"],"properties":{"scopeId":{"$ref":"#/components/schemas/ScopeId"},"scopeType":{"$ref":"#/components/schemas/ScopeType"},"issue":{"$ref":"#/components/schemas/AssetClusterStatusIssueEnum"}}},"ScopeId":{"type":"string","description":"The id of the cluster, department or project, depending on the scope type."},"ScopeType":{"type":"string","enum":["system","tenant","cluster","department","project"]},"AssetClusterStatusIssueEnum":{"type":"string","enum":["ReplicationError","LostPhase","NotCreated"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/asset/environment":{"get":{"summary":"List environment assets.","description":"Use to retrieve a list of environment assets.","operationId":"list_environment_assets","tags":["Environment"],"parameters":[{"$ref":"#/components/parameters/AssetNameFilter"},{"$ref":"#/components/parameters/AssetScopeFilter"},{"$ref":"#/components/parameters/AssetProjectFilter"},{"$ref":"#/components/parameters/AssetDepartmentFilter"},{"$ref":"#/components/parameters/AssetClusterFilter"},{"$ref":"#/components/parameters/IncludeUsageInfo"},{"$ref":"#/components/parameters/ComplyToProject"},{"$ref":"#/components/parameters/ComplyToWorkloadType"},{"$ref":"#/components/parameters/DistributedFrameworkQuery"},{"$ref":"#/components/parameters/IsDistributedQuery"},{"$ref":"#/components/parameters/IsTrainingQuery"},{"$ref":"#/components/parameters/IsWorkspaceQuery"},{"$ref":"#/components/parameters/IsInferenceQuery"},{"$ref":"#/components/parameters/ComplyToReplicaType"},{"$ref":"#/components/parameters/IncludeStatus"},{"$ref":"#/components/parameters/includeDescendants"}],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentListResponse"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Create an environment asset.

> Use to create an environment asset.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Environment","description":"An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. \nIt exposes all the necessary tools (open source, 3rd party, or custom tools) along \nwith their connection interfaces including external node port and the container ports.\nYou can also specify a standard, distributed, or inference workload architecture for the environment.\nAn environment is a mandatory building block for the creation of a workload.\nFor more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"EnvironmentCreationRequest":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetCreationRequest"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"}}},"AssetCreationRequest":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"},{"$ref":"#/components/schemas/AssetCreationFields"}]},"AssetUpdatableFields":{"required":["name"],"properties":{"name":{"$ref":"#/components/schemas/AssetName"},"description":{"$ref":"#/components/schemas/AssetDescription"}}},"AssetName":{"description":"The name of the asset.","type":"string","minLength":1},"AssetDescription":{"description":"The description of the asset.","type":"string","minLength":1,"maxLength":250,"nullable":true},"AssetCreationFields":{"type":"object","required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/Scope"},"clusterId":{"$ref":"#/components/schemas/ClusterIdOptional"},"departmentId":{"description":"The id of the department. Must be specified for department scoped assets.","type":"string","nullable":true,"minLength":1},"projectId":{"description":"The id of the project. Must be specified for project scoped assets.","type":"integer","format":"int32","nullable":true},"autoDelete":{"description":"The asset will be deleted automatically. This is intended for internal use.","type":"boolean","nullable":true,"default":false},"workloadSupportedTypes":{"$ref":"#/components/schemas/WorkloadSupportedTypes"}}},"Scope":{"description":"The scope in which an asset can be used. The highest scope, system, is intended for internal purposes only.","type":"string","minLength":1,"enum":["system","tenant","cluster","department","project"]},"ClusterIdOptional":{"description":"The id of the cluster.","type":"string","format":"uuid","minLength":1,"nullable":true},"WorkloadSupportedTypes":{"properties":{"inference":{"description":"Is inference a supported workload type.","type":"boolean","nullable":true},"workspace":{"description":"Is workspace a supported workload type.","type":"boolean","nullable":true},"training":{"description":"Is training a supported workload type.","type":"boolean","nullable":true},"distributed":{"description":"Is distributed a supported workload type.","type":"boolean","nullable":true},"distFramework":{"description":"The distributed training framework used in the workload.","type":"string","enum":["MPI","PyTorch","TF","XGBoost"],"nullable":true}},"nullable":true,"type":"object"},"EnvironmentAssetSpec":{"allOf":[{"$ref":"#/components/schemas/OverridableSpecFields"},{"$ref":"#/components/schemas/NonOverridableSpecFields"}]},"OverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerOverridable"},{"$ref":"#/components/schemas/CommonSecurityOverridable"},{"$ref":"#/components/schemas/EnvironmentVariablesAssetField"}]},"ContainerOverridable":{"description":"Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"command":{"description":"A command to the server as the entry point of the container running the workload.","type":"string","minLength":1,"nullable":true},"args":{"description":"Arguments to the command that the container running the workload executes.","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"CommonSecurityOverridable":{"description":"Security overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"runAsUid":{"description":"The user id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsUid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"runAsGid":{"description":"The group id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsGid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"supplementalGroups":{"description":"Comma separated list of groups that the user running the container belongs to, in addition to the group indicated by runAsGid. Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled. Using an empty string implies reverting the supplementary groups of the image.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablesAssetField":{"properties":{"environmentVariables":{"$ref":"#/components/schemas/EnvironmentVariablesOfAsset"}},"nullable":true,"type":"object"},"EnvironmentVariablesOfAsset":{"description":"Set of environment variables to populate into the container running the workspace.","type":"array","items":{"$ref":"#/components/schemas/EnvironmentVariableOfAsset"},"nullable":true},"EnvironmentVariableOfAsset":{"description":"Details of an environment variable which is populated into the container.","properties":{"name":{"description":"The name of the environment variable. (mandatory)","type":"string","minLength":1,"nullable":true},"value":{"description":"The value of the environment variable. (mutually exclusive with credential, configMap and podFieldRef)","type":"string","nullable":true},"credential":{"$ref":"#/components/schemas/EnvironmentVariableCredential"},"configMap":{"$ref":"#/components/schemas/EnvironmentVariableConfigMap"},"podFieldRef":{"$ref":"#/components/schemas/EnvironmentVariablePodFieldReference"},"exclude":{"description":"Use 'true' in case the environment variable is defined in defaults of the policy, and you wish to exclude it from the workload.","type":"boolean","nullable":true},"description":{"description":"Description of the environment variable.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableCredential":{"description":"Details of the secret and key use to populate the environment variable. (mutually exclusive with value)","properties":{"assetId":{"description":"Unique identifier of the asset. (mandatory)","type":"string","minLength":1,"format":"uuid","nullable":true},"key":{"description":"The key in the secret resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableConfigMap":{"description":"Details of the configMap and key use to populate the environment variable","properties":{"name":{"description":"The name of the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true},"key":{"description":"The key in the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablePodFieldReference":{"description":"Details of the field-reference and key use to populate the environment variable","properties":{"path":{"description":"The field path resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"NonOverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerNonOverridable"},{"$ref":"#/components/schemas/CommonSecurityNonOverridable"},{"$ref":"#/components/schemas/ContainerNonInferenceNonOverridable"},{"$ref":"#/components/schemas/NonInferenceSecurityNonOverridable"},{"properties":{"connections":{"description":"List of connections that either expose ports from the container (each port is associated with a tool that the container runs), or URL's to be used for connecting to an external tool that is related to the action of the container (such as Weights & Biases).","type":"array","items":{"$ref":"#/components/schemas/Connection"}},"overrideUidGidInWorkspace":{"description":"Allow specifying uid/gid as part of create workspace. This is relevant only for custom uigGidSource.","type":"boolean","default":false}}}]},"ContainerNonOverridable":{"description":"Container non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"image":{"description":"Docker image name. For more information, see [Images](https://kubernetes.io/docs/concepts/containers/images). The image name is mandatory for creating a workload.","type":"string","minLength":1,"nullable":true},"imagePullPolicy":{"$ref":"#/components/schemas/ImagePullPolicy"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime default will be used. This may be configured in the container image.","type":"string","minLength":1,"nullable":true},"createHomeDir":{"description":"When set to `true`, creates a home directory for the container.","type":"boolean","nullable":true},"probes":{"$ref":"#/components/schemas/Probes"}},"nullable":true,"type":"object"},"ImagePullPolicy":{"description":"Image pull policy. Defaults to `Always` if `:latest` tag is specified, otherwise it is `IfNotPresent`.","type":"string","minLength":1,"enum":["Always","Never","IfNotPresent"],"nullable":true},"Probes":{"description":"Probes are used to determine if the container is healthy and ready to accept traffic.","type":"object","properties":{"readiness":{"$ref":"#/components/schemas/Probe"}},"nullable":true},"Probe":{"type":"object","properties":{"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness or readiness probes are initiated.","type":"integer","format":"int32","minimum":0,"nullable":true},"periodSeconds":{"description":"How often (in seconds) to perform the probe.","type":"integer","format":"int32","minimum":1,"nullable":true},"timeoutSeconds":{"description":"Number of seconds after which the probe times out.","type":"integer","format":"int32","minimum":1,"nullable":true},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed.","type":"integer","format":"int32","minimum":1,"nullable":true},"failureThreshold":{"description":"When a probe fails, the number of times to try before giving up.","type":"integer","format":"int32","minimum":1,"nullable":true},"handler":{"$ref":"#/components/schemas/ProbeHandler"}},"nullable":true},"ProbeHandler":{"description":"The action taken to determine the health of the container. (mandatory)","type":"object","properties":{"httpGet":{"description":"An action based on HTTP Get requests.","type":"object","properties":{"path":{"description":"Path to access on the HTTP server, defaults to /.","type":"string","pattern":"^(\\x2F[a-zA-Z0-9\\-_.\\x2F]*)?$","nullable":true},"port":{"description":"Number of the port to access on the container.","type":"integer","format":"int32","minimum":1,"maximum":65535,"nullable":true},"host":{"description":"Host name to connect to, defaults to the pod IP.","type":"string","format":"hostname","nullable":true},"scheme":{"$ref":"#/components/schemas/ProbeHandlerScheme"}}}},"nullable":true},"ProbeHandlerScheme":{"description":"Scheme to use for connecting to the host, defaults to HTTP.","type":"string","enum":["HTTP","HTTPS"],"nullable":true},"CommonSecurityNonOverridable":{"description":"Security non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"uidGidSource":{"$ref":"#/components/schemas/UidGidSource"},"capabilities":{"description":"Add POSIX capabilities to running containers. Defaults to the default set of capabilities granted by the container runtime.","type":"array","items":{"$ref":"#/components/schemas/Capability"},"nullable":true},"seccompProfileType":{"$ref":"#/components/schemas/SeccompProfileType"},"runAsNonRoot":{"description":"Force the container to run as a non-root user.","type":"boolean","nullable":true},"readOnlyRootFilesystem":{"description":"If true, mounts the container's root filesystem as read-only.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"UidGidSource":{"description":"Indicate the way to determine the user and group ids of the container. The options are a. `fromTheImage` - user and group ids are determined by the docker image that the container runs. this is the default option. b. `custom` - user and group ids can be specified in the environment asset and/or the workload creation request. c. `idpToken` - user and group ids are determined according to the identity provider (idp) access token. This option is intended for internal use of the environment UI form. For more information, see [User Identity](https://run-ai-docs.nvidia.com/self-hosted/2.22/admin/runai-setup/config/non-root-containers/).","type":"string","enum":["fromTheImage","fromIdpToken","custom"],"nullable":true},"Capability":{"type":"string","enum":["AUDIT_CONTROL","AUDIT_READ","AUDIT_WRITE","BLOCK_SUSPEND","CHOWN","DAC_OVERRIDE","DAC_READ_SEARCH","FOWNER","FSETID","IPC_LOCK","IPC_OWNER","KILL","LEASE","LINUX_IMMUTABLE","MAC_ADMIN","MAC_OVERRIDE","MKNOD","NET_ADMIN","NET_BIND_SERVICE","NET_BROADCAST","NET_RAW","SETGID","SETFCAP","SETPCAP","SETUID","SYS_ADMIN","SYS_BOOT","SYS_CHROOT","SYS_MODULE","SYS_NICE","SYS_PACCT","SYS_PTRACE","SYS_RAWIO","SYS_RESOURCE","SYS_TIME","SYS_TTY_CONFIG","SYSLOG","WAKE_ALARM"]},"SeccompProfileType":{"description":"Indicates which kind of seccomp profile will be applied to the container. The options are a. `RuntimeDefault` - the container runtime default profile should be used. b. `Unconfined` - no profile should be applied. c. `Localhost` is not yet supported by Run:ai.","type":"string","enum":["RuntimeDefault","Unconfined","Localhost"],"nullable":true},"ContainerNonInferenceNonOverridable":{"description":"Container non Inference overrideable fields. It adds properties which are not allowed for Inference containers","properties":{"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.","type":"boolean","nullable":true},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"NonInferenceSecurityNonOverridable":{"description":"Security related fields. When used in assets context, those are environment asset fields that cannot be override in the submit workload request.","properties":{"allowPrivilegeEscalation":{"description":"Allow the container running the workload and all launched processes to gain additional privileges after the workload starts. For more information consult the User Identity in Container guide at https://docs.run.ai/admin/runai-setup/config/non-root-containers/","type":"boolean","nullable":true},"hostIpc":{"description":"Whether to enable host IPC. Defaults to false.","type":"boolean","nullable":true},"hostNetwork":{"description":"Whether to enable host networking. Default to false.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"Connection":{"required":["name"],"properties":{"name":{"description":"A unique name of this connection. This name correlates between the connection information specified at the environment asset, to the information about the connection as specified in SpecificEnv for a specific workspace.","type":"string","minLength":1},"isExternal":{"description":"Internal tools (isExternal=false) are tools that run as part of the container. External tools (isExternal=true) run outside the container, typically in the cloud.","type":"boolean","default":false},"internalToolInfo":{"$ref":"#/components/schemas/InternalToolInfo"},"externalToolInfo":{"$ref":"#/components/schemas/ExternalToolInfo"}}},"InternalToolInfo":{"description":"Information of the internal tool.","required":["toolType","connectionType","containerPort"],"properties":{"toolType":{"$ref":"#/components/schemas/InternalToolType"},"connectionType":{"$ref":"#/components/schemas/InternalConnectionType"},"containerPort":{"description":"The port within the container that the connection exposes.","type":"integer","format":"int32","minimum":1,"maximum":65535},"nodePortInfo":{"$ref":"#/components/schemas/NodePortInfo"},"externalUrlInfo":{"$ref":"#/components/schemas/ExternalUrlInfo"},"servingPortInfo":{"$ref":"#/components/schemas/ServingPortInfo"}},"nullable":true,"type":"object"},"InternalToolType":{"description":"The type of the internal tool. Internal tool runs within the container and exposes ports associated with the tool using NodePort, LoadBalancer or ExternalUrl.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","matlab","chatbot-ui"]},"InternalConnectionType":{"description":"The type of connection that exposes the container port.","type":"string","minLength":1,"enum":["LoadBalancer","NodePort","ExternalUrl","ServingPort"]},"NodePortInfo":{"properties":{"isCustomPort":{"description":"Whether the node port is provided in the specific env of the workspace. Default is false, and in this case the node port is auto generated by the system.","type":"boolean","default":false}},"nullable":true,"type":"object"},"ExternalUrlInfo":{"properties":{"isCustomUrl":{"description":"Whether external url is provided in the specific env of the workspace. Default is false, and in this case the external url is auto generated by the system.","type":"boolean","default":false},"externalUrl":{"description":"Default value for the external url. You can override it in the specific env of the workspace. Should be specified for ExternalUrl only.","type":"string","nullable":true,"minLength":1}},"nullable":true,"type":"object"},"ServingPortInfo":{"properties":{"protocol":{"type":"string","enum":["grpc","http"],"nullable":true}},"nullable":true,"type":"object"},"ExternalToolInfo":{"description":"Information of the external tool.","required":["toolType","externalUrl"],"properties":{"toolType":{"$ref":"#/components/schemas/ExternalToolType"},"externalUrl":{"description":"The external url for connecting to the external tool. The url can include environment variables that will be replaced with the value provided for those variables when the workspace is created.","type":"string","minLength":1}},"nullable":true,"type":"object"},"ExternalToolType":{"description":"The type of external tool that is associated with the connection. External tool typically runs in the cloud and require external url for connecting to it.","type":"string","minLength":1,"enum":["wandb","comet"]},"EnvironmentAsset":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetMeta"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"},"usedBy":{"$ref":"#/components/schemas/AssetUsageInfo"},"usageTimes":{"$ref":"#/components/schemas/UsageTimesInfo"},"compliance":{"$ref":"#/components/schemas/ComplianceInfo"},"status":{"$ref":"#/components/schemas/AssetClusterStatusInfo"}}},"AssetMeta":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"},{"$ref":"#/components/schemas/AssetCreationFields"},{"$ref":"#/components/schemas/AssetReadOnlyFields"}]},"AssetReadOnlyFields":{"required":["id","kind","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"kind":{"$ref":"#/components/schemas/AssetKind"},"tenantId":{"description":"The id of the tenant.","type":"integer","format":"int32","nullable":true},"createdBy":{"description":"The user who created the asset.","type":"string","minLength":1},"createdAt":{"description":"The time at which the asset were created","type":"string","minLength":1,"format":"date-time"},"updatedBy":{"description":"The user who updated the asset.","type":"string","minLength":1},"updatedAt":{"description":"The time at which the asset has been updated","type":"string","minLength":1,"format":"date-time"},"deletedAt":{"description":"Deletion time of the asset (relevant for assets that sync to the cluster)","type":"string","minLength":1,"format":"date-time"},"deletedBy":{"description":"The user who deleted the asset","type":"string","minLength":1},"projectName":{"description":"The name of the project that the asset is associated with, for project scoped assets.","type":"string","minLength":1,"nullable":true},"updateCount":{"$ref":"#/components/schemas/UpdateCount"}},"type":"object"},"AssetId":{"description":"Unique identifier of the asset.","type":"string","format":"uuid","minLength":1},"AssetKind":{"description":"The kind of the asset.","type":"string","minLength":1,"enum":["compute","environment","accessKey","dockerRegistry","password","genericSecret","registry","s3","git","nfs","pvc","hostPath","workload-template","model","config-map","secret-volume","data-volume"]},"UpdateCount":{"description":"the value of an update counter of a data in the system.","type":"integer","format":"int64"},"AssetUsageInfo":{"description":"Details about resources that use the asset.","properties":{"workspaces":{"description":"workspaces that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"trainings":{"description":"trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"distributed":{"description":"distributed trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"inferences":{"description":"inferences that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"templates":{"description":"templates that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"assets":{"description":"list of other assets that use this asset. specifically, accessKeys used by s3, and passwords used by git.","$ref":"#/components/schemas/AssetsUsageRef"}},"nullable":true,"type":"object"},"WorkloadRefAndStatus":{"description":"Id, name and status of a workspace or training","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/WorkloadId1"},"name":{"$ref":"#/components/schemas/WorkloadName"},"status":{"description":"The status of the workspace or training.","type":"string","minLength":1}}},"WorkloadId1":{"description":"A unique ID of the workload.","type":"string","format":"uuid"},"WorkloadName":{"description":"The name of the workload.","type":"string","minLength":1},"AssetRef":{"description":"Reference information about an asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"}}},"AssetsUsageRef":{"description":"Reference information about usage of assets by other assets, for example datasources that uses credentials.","properties":{"environment":{"nullable":true,"type":"object","description":"environment asset.","allOf":[{"$ref":"#/components/schemas/EnvironmentAssetRef"}],"deprecated":true},"environments":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"compute":{"$ref":"#/components/schemas/AssetsUsageRefCompute","deprecated":true},"computes":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"datasources":{"type":"array","items":{"$ref":"#/components/schemas/AssetDatasourceRef"}}}},"EnvironmentAssetRef":{"description":"Reference information about environment asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"toolTypes":{"description":"the type of tools as defined in the connections of the environment asset.","type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ToolType"}}}},"ToolType":{"description":"Super set of Internal and External tool types.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","wandb","matlab","comet","chatbot-ui"]},"AssetsUsageRefCompute":{"allOf":[{"$ref":"#/components/schemas/AssetRef"}],"nullable":true,"type":"object"},"AssetDatasourceRef":{"description":"Reference information about a datasource asset.","required":["id","name","kind"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"kind":{"$ref":"#/components/schemas/AssetKind"},"overrides":{"$ref":"#/components/schemas/DataSourceOverrides","deprecated":true}}},"DataSourceOverrides":{"description":"specific fields to override in the data source.","type":"object","nullable":true,"properties":{"containerPath":{"type":"string","minLength":1,"nullable":true}}},"UsageTimesInfo":{"description":"Details about times the asset has been used by workloads, etc.","properties":{"lastUsedByWorkload":{"description":"The time at which the asset were last used by a workload of given type and project. This field requires complyToProject and complyToWorkload types flags of the API, to specify the workload type and project id.","type":"string","minLength":1,"format":"date-time","nullable":true}},"nullable":true,"type":"object"},"ComplianceInfo":{"description":"Compliance of the asset with creation of workloads in the given project.","properties":{"imposed":{"description":"Whether the asset is imposed on created workloads by the administrator.","type":"boolean"},"compliance":{"description":"Whether the asset info complies with creation of workloads in the project.","type":"boolean"},"reason":{"description":"For asset that does not comply, specify one or more reason why.","type":"array","items":{"$ref":"#/components/schemas/ComplianceInfoReason"}}},"nullable":true,"type":"object"},"ComplianceInfoReason":{"description":"A reason explaining why the asset does not comply with workloads creation for a given project.","required":["details"],"properties":{"field":{"description":"for policy related issues, includes a json path to the field in the policy for which the message applies.","nullable":true,"type":"string"},"details":{"description":"explanation of the reason for rejecting the asset.","type":"string"}}},"AssetClusterStatusInfo":{"properties":{"status":{"$ref":"#/components/schemas/AssetSyncStatusEnum"},"issues":{"$ref":"#/components/schemas/AssetClusterStatusIssues"},"message":{"type":"string"},"url":{"type":"string"}},"nullable":true,"type":"object"},"AssetSyncStatusEnum":{"type":"string","enum":["Creating","Deleting","Failed","Deletion failed","Issues found","No issues found","No status","Updating"]},"AssetClusterStatusIssues":{"type":"array","items":{"$ref":"#/components/schemas/AssetClusterStatusIssue"}},"AssetClusterStatusIssue":{"type":"object","required":["scopeId","scopeType","issue"],"properties":{"scopeId":{"$ref":"#/components/schemas/ScopeId"},"scopeType":{"$ref":"#/components/schemas/ScopeType"},"issue":{"$ref":"#/components/schemas/AssetClusterStatusIssueEnum"}}},"ScopeId":{"type":"string","description":"The id of the cluster, department or project, depending on the scope type."},"ScopeType":{"type":"string","enum":["system","tenant","cluster","department","project"]},"AssetClusterStatusIssueEnum":{"type":"string","enum":["ReplicationError","LostPhase","NotCreated"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409Conflict":{"description":"The specified resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/asset/environment":{"post":{"summary":"Create an environment asset.","description":"Use to create an environment asset.","operationId":"create_environment_asset","tags":["Environment"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentCreationRequest"}}}},"responses":{"202":{"description":"Request accepted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentAsset"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"409":{"$ref":"#/components/responses/409Conflict"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get an environment asset.

> Use to retrieve the details of environment asset by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Environment","description":"An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. \nIt exposes all the necessary tools (open source, 3rd party, or custom tools) along \nwith their connection interfaces including external node port and the container ports.\nYou can also specify a standard, distributed, or inference workload architecture for the environment.\nAn environment is a mandatory building block for the creation of a workload.\nFor more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"IncludeUsageInfo":{"name":"usageInfo","in":"query","required":false,"description":"Whether the query should include asset usage information as part of the response.","schema":{"type":"boolean"}},"ComplyToProject":{"name":"complyToProject","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given project, as part of the response. To check compliance, you need to provide both project id and workload type.","schema":{"type":"integer","format":"int32"}},"ComplyToWorkloadType":{"name":"complyToWorkloadType","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given workload type, as part of the response. To check compliance, you need to provide both project id and workload type.","schema":{"type":"string","enum":["Workspace","Training","Distributed","Inference"]}},"ComplyToReplicaType":{"name":"complyToReplicaType","in":"query","required":false,"description":"Include workload creation compliance information of an asset, for a given replica type, as part of the response. To check compliance, you need to provide both project id and workload type. For distributed, replica type should be provided as well.","schema":{"type":"string","enum":["Worker","Master"]}},"IncludeStatus":{"name":"statusInfo","in":"query","required":false,"description":"Whether the query should include asset status information as part of the response.","schema":{"type":"boolean"}}},"schemas":{"EnvironmentAsset":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetMeta"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"},"usedBy":{"$ref":"#/components/schemas/AssetUsageInfo"},"usageTimes":{"$ref":"#/components/schemas/UsageTimesInfo"},"compliance":{"$ref":"#/components/schemas/ComplianceInfo"},"status":{"$ref":"#/components/schemas/AssetClusterStatusInfo"}}},"AssetMeta":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"},{"$ref":"#/components/schemas/AssetCreationFields"},{"$ref":"#/components/schemas/AssetReadOnlyFields"}]},"AssetUpdatableFields":{"required":["name"],"properties":{"name":{"$ref":"#/components/schemas/AssetName"},"description":{"$ref":"#/components/schemas/AssetDescription"}}},"AssetName":{"description":"The name of the asset.","type":"string","minLength":1},"AssetDescription":{"description":"The description of the asset.","type":"string","minLength":1,"maxLength":250,"nullable":true},"AssetCreationFields":{"type":"object","required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/Scope"},"clusterId":{"$ref":"#/components/schemas/ClusterIdOptional"},"departmentId":{"description":"The id of the department. Must be specified for department scoped assets.","type":"string","nullable":true,"minLength":1},"projectId":{"description":"The id of the project. Must be specified for project scoped assets.","type":"integer","format":"int32","nullable":true},"autoDelete":{"description":"The asset will be deleted automatically. This is intended for internal use.","type":"boolean","nullable":true,"default":false},"workloadSupportedTypes":{"$ref":"#/components/schemas/WorkloadSupportedTypes"}}},"Scope":{"description":"The scope in which an asset can be used. The highest scope, system, is intended for internal purposes only.","type":"string","minLength":1,"enum":["system","tenant","cluster","department","project"]},"ClusterIdOptional":{"description":"The id of the cluster.","type":"string","format":"uuid","minLength":1,"nullable":true},"WorkloadSupportedTypes":{"properties":{"inference":{"description":"Is inference a supported workload type.","type":"boolean","nullable":true},"workspace":{"description":"Is workspace a supported workload type.","type":"boolean","nullable":true},"training":{"description":"Is training a supported workload type.","type":"boolean","nullable":true},"distributed":{"description":"Is distributed a supported workload type.","type":"boolean","nullable":true},"distFramework":{"description":"The distributed training framework used in the workload.","type":"string","enum":["MPI","PyTorch","TF","XGBoost"],"nullable":true}},"nullable":true,"type":"object"},"AssetReadOnlyFields":{"required":["id","kind","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"kind":{"$ref":"#/components/schemas/AssetKind"},"tenantId":{"description":"The id of the tenant.","type":"integer","format":"int32","nullable":true},"createdBy":{"description":"The user who created the asset.","type":"string","minLength":1},"createdAt":{"description":"The time at which the asset were created","type":"string","minLength":1,"format":"date-time"},"updatedBy":{"description":"The user who updated the asset.","type":"string","minLength":1},"updatedAt":{"description":"The time at which the asset has been updated","type":"string","minLength":1,"format":"date-time"},"deletedAt":{"description":"Deletion time of the asset (relevant for assets that sync to the cluster)","type":"string","minLength":1,"format":"date-time"},"deletedBy":{"description":"The user who deleted the asset","type":"string","minLength":1},"projectName":{"description":"The name of the project that the asset is associated with, for project scoped assets.","type":"string","minLength":1,"nullable":true},"updateCount":{"$ref":"#/components/schemas/UpdateCount"}},"type":"object"},"AssetId":{"description":"Unique identifier of the asset.","type":"string","format":"uuid","minLength":1},"AssetKind":{"description":"The kind of the asset.","type":"string","minLength":1,"enum":["compute","environment","accessKey","dockerRegistry","password","genericSecret","registry","s3","git","nfs","pvc","hostPath","workload-template","model","config-map","secret-volume","data-volume"]},"UpdateCount":{"description":"the value of an update counter of a data in the system.","type":"integer","format":"int64"},"EnvironmentAssetSpec":{"allOf":[{"$ref":"#/components/schemas/OverridableSpecFields"},{"$ref":"#/components/schemas/NonOverridableSpecFields"}]},"OverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerOverridable"},{"$ref":"#/components/schemas/CommonSecurityOverridable"},{"$ref":"#/components/schemas/EnvironmentVariablesAssetField"}]},"ContainerOverridable":{"description":"Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"command":{"description":"A command to the server as the entry point of the container running the workload.","type":"string","minLength":1,"nullable":true},"args":{"description":"Arguments to the command that the container running the workload executes.","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"CommonSecurityOverridable":{"description":"Security overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"runAsUid":{"description":"The user id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsUid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"runAsGid":{"description":"The group id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsGid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"supplementalGroups":{"description":"Comma separated list of groups that the user running the container belongs to, in addition to the group indicated by runAsGid. Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled. Using an empty string implies reverting the supplementary groups of the image.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablesAssetField":{"properties":{"environmentVariables":{"$ref":"#/components/schemas/EnvironmentVariablesOfAsset"}},"nullable":true,"type":"object"},"EnvironmentVariablesOfAsset":{"description":"Set of environment variables to populate into the container running the workspace.","type":"array","items":{"$ref":"#/components/schemas/EnvironmentVariableOfAsset"},"nullable":true},"EnvironmentVariableOfAsset":{"description":"Details of an environment variable which is populated into the container.","properties":{"name":{"description":"The name of the environment variable. (mandatory)","type":"string","minLength":1,"nullable":true},"value":{"description":"The value of the environment variable. (mutually exclusive with credential, configMap and podFieldRef)","type":"string","nullable":true},"credential":{"$ref":"#/components/schemas/EnvironmentVariableCredential"},"configMap":{"$ref":"#/components/schemas/EnvironmentVariableConfigMap"},"podFieldRef":{"$ref":"#/components/schemas/EnvironmentVariablePodFieldReference"},"exclude":{"description":"Use 'true' in case the environment variable is defined in defaults of the policy, and you wish to exclude it from the workload.","type":"boolean","nullable":true},"description":{"description":"Description of the environment variable.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableCredential":{"description":"Details of the secret and key use to populate the environment variable. (mutually exclusive with value)","properties":{"assetId":{"description":"Unique identifier of the asset. (mandatory)","type":"string","minLength":1,"format":"uuid","nullable":true},"key":{"description":"The key in the secret resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableConfigMap":{"description":"Details of the configMap and key use to populate the environment variable","properties":{"name":{"description":"The name of the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true},"key":{"description":"The key in the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablePodFieldReference":{"description":"Details of the field-reference and key use to populate the environment variable","properties":{"path":{"description":"The field path resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"NonOverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerNonOverridable"},{"$ref":"#/components/schemas/CommonSecurityNonOverridable"},{"$ref":"#/components/schemas/ContainerNonInferenceNonOverridable"},{"$ref":"#/components/schemas/NonInferenceSecurityNonOverridable"},{"properties":{"connections":{"description":"List of connections that either expose ports from the container (each port is associated with a tool that the container runs), or URL's to be used for connecting to an external tool that is related to the action of the container (such as Weights & Biases).","type":"array","items":{"$ref":"#/components/schemas/Connection"}},"overrideUidGidInWorkspace":{"description":"Allow specifying uid/gid as part of create workspace. This is relevant only for custom uigGidSource.","type":"boolean","default":false}}}]},"ContainerNonOverridable":{"description":"Container non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"image":{"description":"Docker image name. For more information, see [Images](https://kubernetes.io/docs/concepts/containers/images). The image name is mandatory for creating a workload.","type":"string","minLength":1,"nullable":true},"imagePullPolicy":{"$ref":"#/components/schemas/ImagePullPolicy"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime default will be used. This may be configured in the container image.","type":"string","minLength":1,"nullable":true},"createHomeDir":{"description":"When set to `true`, creates a home directory for the container.","type":"boolean","nullable":true},"probes":{"$ref":"#/components/schemas/Probes"}},"nullable":true,"type":"object"},"ImagePullPolicy":{"description":"Image pull policy. Defaults to `Always` if `:latest` tag is specified, otherwise it is `IfNotPresent`.","type":"string","minLength":1,"enum":["Always","Never","IfNotPresent"],"nullable":true},"Probes":{"description":"Probes are used to determine if the container is healthy and ready to accept traffic.","type":"object","properties":{"readiness":{"$ref":"#/components/schemas/Probe"}},"nullable":true},"Probe":{"type":"object","properties":{"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness or readiness probes are initiated.","type":"integer","format":"int32","minimum":0,"nullable":true},"periodSeconds":{"description":"How often (in seconds) to perform the probe.","type":"integer","format":"int32","minimum":1,"nullable":true},"timeoutSeconds":{"description":"Number of seconds after which the probe times out.","type":"integer","format":"int32","minimum":1,"nullable":true},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed.","type":"integer","format":"int32","minimum":1,"nullable":true},"failureThreshold":{"description":"When a probe fails, the number of times to try before giving up.","type":"integer","format":"int32","minimum":1,"nullable":true},"handler":{"$ref":"#/components/schemas/ProbeHandler"}},"nullable":true},"ProbeHandler":{"description":"The action taken to determine the health of the container. (mandatory)","type":"object","properties":{"httpGet":{"description":"An action based on HTTP Get requests.","type":"object","properties":{"path":{"description":"Path to access on the HTTP server, defaults to /.","type":"string","pattern":"^(\\x2F[a-zA-Z0-9\\-_.\\x2F]*)?$","nullable":true},"port":{"description":"Number of the port to access on the container.","type":"integer","format":"int32","minimum":1,"maximum":65535,"nullable":true},"host":{"description":"Host name to connect to, defaults to the pod IP.","type":"string","format":"hostname","nullable":true},"scheme":{"$ref":"#/components/schemas/ProbeHandlerScheme"}}}},"nullable":true},"ProbeHandlerScheme":{"description":"Scheme to use for connecting to the host, defaults to HTTP.","type":"string","enum":["HTTP","HTTPS"],"nullable":true},"CommonSecurityNonOverridable":{"description":"Security non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"uidGidSource":{"$ref":"#/components/schemas/UidGidSource"},"capabilities":{"description":"Add POSIX capabilities to running containers. Defaults to the default set of capabilities granted by the container runtime.","type":"array","items":{"$ref":"#/components/schemas/Capability"},"nullable":true},"seccompProfileType":{"$ref":"#/components/schemas/SeccompProfileType"},"runAsNonRoot":{"description":"Force the container to run as a non-root user.","type":"boolean","nullable":true},"readOnlyRootFilesystem":{"description":"If true, mounts the container's root filesystem as read-only.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"UidGidSource":{"description":"Indicate the way to determine the user and group ids of the container. The options are a. `fromTheImage` - user and group ids are determined by the docker image that the container runs. this is the default option. b. `custom` - user and group ids can be specified in the environment asset and/or the workload creation request. c. `idpToken` - user and group ids are determined according to the identity provider (idp) access token. This option is intended for internal use of the environment UI form. For more information, see [User Identity](https://run-ai-docs.nvidia.com/self-hosted/2.22/admin/runai-setup/config/non-root-containers/).","type":"string","enum":["fromTheImage","fromIdpToken","custom"],"nullable":true},"Capability":{"type":"string","enum":["AUDIT_CONTROL","AUDIT_READ","AUDIT_WRITE","BLOCK_SUSPEND","CHOWN","DAC_OVERRIDE","DAC_READ_SEARCH","FOWNER","FSETID","IPC_LOCK","IPC_OWNER","KILL","LEASE","LINUX_IMMUTABLE","MAC_ADMIN","MAC_OVERRIDE","MKNOD","NET_ADMIN","NET_BIND_SERVICE","NET_BROADCAST","NET_RAW","SETGID","SETFCAP","SETPCAP","SETUID","SYS_ADMIN","SYS_BOOT","SYS_CHROOT","SYS_MODULE","SYS_NICE","SYS_PACCT","SYS_PTRACE","SYS_RAWIO","SYS_RESOURCE","SYS_TIME","SYS_TTY_CONFIG","SYSLOG","WAKE_ALARM"]},"SeccompProfileType":{"description":"Indicates which kind of seccomp profile will be applied to the container. The options are a. `RuntimeDefault` - the container runtime default profile should be used. b. `Unconfined` - no profile should be applied. c. `Localhost` is not yet supported by Run:ai.","type":"string","enum":["RuntimeDefault","Unconfined","Localhost"],"nullable":true},"ContainerNonInferenceNonOverridable":{"description":"Container non Inference overrideable fields. It adds properties which are not allowed for Inference containers","properties":{"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.","type":"boolean","nullable":true},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"NonInferenceSecurityNonOverridable":{"description":"Security related fields. When used in assets context, those are environment asset fields that cannot be override in the submit workload request.","properties":{"allowPrivilegeEscalation":{"description":"Allow the container running the workload and all launched processes to gain additional privileges after the workload starts. For more information consult the User Identity in Container guide at https://docs.run.ai/admin/runai-setup/config/non-root-containers/","type":"boolean","nullable":true},"hostIpc":{"description":"Whether to enable host IPC. Defaults to false.","type":"boolean","nullable":true},"hostNetwork":{"description":"Whether to enable host networking. Default to false.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"Connection":{"required":["name"],"properties":{"name":{"description":"A unique name of this connection. This name correlates between the connection information specified at the environment asset, to the information about the connection as specified in SpecificEnv for a specific workspace.","type":"string","minLength":1},"isExternal":{"description":"Internal tools (isExternal=false) are tools that run as part of the container. External tools (isExternal=true) run outside the container, typically in the cloud.","type":"boolean","default":false},"internalToolInfo":{"$ref":"#/components/schemas/InternalToolInfo"},"externalToolInfo":{"$ref":"#/components/schemas/ExternalToolInfo"}}},"InternalToolInfo":{"description":"Information of the internal tool.","required":["toolType","connectionType","containerPort"],"properties":{"toolType":{"$ref":"#/components/schemas/InternalToolType"},"connectionType":{"$ref":"#/components/schemas/InternalConnectionType"},"containerPort":{"description":"The port within the container that the connection exposes.","type":"integer","format":"int32","minimum":1,"maximum":65535},"nodePortInfo":{"$ref":"#/components/schemas/NodePortInfo"},"externalUrlInfo":{"$ref":"#/components/schemas/ExternalUrlInfo"},"servingPortInfo":{"$ref":"#/components/schemas/ServingPortInfo"}},"nullable":true,"type":"object"},"InternalToolType":{"description":"The type of the internal tool. Internal tool runs within the container and exposes ports associated with the tool using NodePort, LoadBalancer or ExternalUrl.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","matlab","chatbot-ui"]},"InternalConnectionType":{"description":"The type of connection that exposes the container port.","type":"string","minLength":1,"enum":["LoadBalancer","NodePort","ExternalUrl","ServingPort"]},"NodePortInfo":{"properties":{"isCustomPort":{"description":"Whether the node port is provided in the specific env of the workspace. Default is false, and in this case the node port is auto generated by the system.","type":"boolean","default":false}},"nullable":true,"type":"object"},"ExternalUrlInfo":{"properties":{"isCustomUrl":{"description":"Whether external url is provided in the specific env of the workspace. Default is false, and in this case the external url is auto generated by the system.","type":"boolean","default":false},"externalUrl":{"description":"Default value for the external url. You can override it in the specific env of the workspace. Should be specified for ExternalUrl only.","type":"string","nullable":true,"minLength":1}},"nullable":true,"type":"object"},"ServingPortInfo":{"properties":{"protocol":{"type":"string","enum":["grpc","http"],"nullable":true}},"nullable":true,"type":"object"},"ExternalToolInfo":{"description":"Information of the external tool.","required":["toolType","externalUrl"],"properties":{"toolType":{"$ref":"#/components/schemas/ExternalToolType"},"externalUrl":{"description":"The external url for connecting to the external tool. The url can include environment variables that will be replaced with the value provided for those variables when the workspace is created.","type":"string","minLength":1}},"nullable":true,"type":"object"},"ExternalToolType":{"description":"The type of external tool that is associated with the connection. External tool typically runs in the cloud and require external url for connecting to it.","type":"string","minLength":1,"enum":["wandb","comet"]},"AssetUsageInfo":{"description":"Details about resources that use the asset.","properties":{"workspaces":{"description":"workspaces that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"trainings":{"description":"trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"distributed":{"description":"distributed trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"inferences":{"description":"inferences that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"templates":{"description":"templates that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"assets":{"description":"list of other assets that use this asset. specifically, accessKeys used by s3, and passwords used by git.","$ref":"#/components/schemas/AssetsUsageRef"}},"nullable":true,"type":"object"},"WorkloadRefAndStatus":{"description":"Id, name and status of a workspace or training","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/WorkloadId1"},"name":{"$ref":"#/components/schemas/WorkloadName"},"status":{"description":"The status of the workspace or training.","type":"string","minLength":1}}},"WorkloadId1":{"description":"A unique ID of the workload.","type":"string","format":"uuid"},"WorkloadName":{"description":"The name of the workload.","type":"string","minLength":1},"AssetRef":{"description":"Reference information about an asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"}}},"AssetsUsageRef":{"description":"Reference information about usage of assets by other assets, for example datasources that uses credentials.","properties":{"environment":{"nullable":true,"type":"object","description":"environment asset.","allOf":[{"$ref":"#/components/schemas/EnvironmentAssetRef"}],"deprecated":true},"environments":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"compute":{"$ref":"#/components/schemas/AssetsUsageRefCompute","deprecated":true},"computes":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"datasources":{"type":"array","items":{"$ref":"#/components/schemas/AssetDatasourceRef"}}}},"EnvironmentAssetRef":{"description":"Reference information about environment asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"toolTypes":{"description":"the type of tools as defined in the connections of the environment asset.","type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ToolType"}}}},"ToolType":{"description":"Super set of Internal and External tool types.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","wandb","matlab","comet","chatbot-ui"]},"AssetsUsageRefCompute":{"allOf":[{"$ref":"#/components/schemas/AssetRef"}],"nullable":true,"type":"object"},"AssetDatasourceRef":{"description":"Reference information about a datasource asset.","required":["id","name","kind"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"kind":{"$ref":"#/components/schemas/AssetKind"},"overrides":{"$ref":"#/components/schemas/DataSourceOverrides","deprecated":true}}},"DataSourceOverrides":{"description":"specific fields to override in the data source.","type":"object","nullable":true,"properties":{"containerPath":{"type":"string","minLength":1,"nullable":true}}},"UsageTimesInfo":{"description":"Details about times the asset has been used by workloads, etc.","properties":{"lastUsedByWorkload":{"description":"The time at which the asset were last used by a workload of given type and project. This field requires complyToProject and complyToWorkload types flags of the API, to specify the workload type and project id.","type":"string","minLength":1,"format":"date-time","nullable":true}},"nullable":true,"type":"object"},"ComplianceInfo":{"description":"Compliance of the asset with creation of workloads in the given project.","properties":{"imposed":{"description":"Whether the asset is imposed on created workloads by the administrator.","type":"boolean"},"compliance":{"description":"Whether the asset info complies with creation of workloads in the project.","type":"boolean"},"reason":{"description":"For asset that does not comply, specify one or more reason why.","type":"array","items":{"$ref":"#/components/schemas/ComplianceInfoReason"}}},"nullable":true,"type":"object"},"ComplianceInfoReason":{"description":"A reason explaining why the asset does not comply with workloads creation for a given project.","required":["details"],"properties":{"field":{"description":"for policy related issues, includes a json path to the field in the policy for which the message applies.","nullable":true,"type":"string"},"details":{"description":"explanation of the reason for rejecting the asset.","type":"string"}}},"AssetClusterStatusInfo":{"properties":{"status":{"$ref":"#/components/schemas/AssetSyncStatusEnum"},"issues":{"$ref":"#/components/schemas/AssetClusterStatusIssues"},"message":{"type":"string"},"url":{"type":"string"}},"nullable":true,"type":"object"},"AssetSyncStatusEnum":{"type":"string","enum":["Creating","Deleting","Failed","Deletion failed","Issues found","No issues found","No status","Updating"]},"AssetClusterStatusIssues":{"type":"array","items":{"$ref":"#/components/schemas/AssetClusterStatusIssue"}},"AssetClusterStatusIssue":{"type":"object","required":["scopeId","scopeType","issue"],"properties":{"scopeId":{"$ref":"#/components/schemas/ScopeId"},"scopeType":{"$ref":"#/components/schemas/ScopeType"},"issue":{"$ref":"#/components/schemas/AssetClusterStatusIssueEnum"}}},"ScopeId":{"type":"string","description":"The id of the cluster, department or project, depending on the scope type."},"ScopeType":{"type":"string","enum":["system","tenant","cluster","department","project"]},"AssetClusterStatusIssueEnum":{"type":"string","enum":["ReplicationError","LostPhase","NotCreated"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/asset/environment/{AssetId}":{"get":{"summary":"Get an environment asset.","description":"Use to retrieve the details of environment asset by id.","operationId":"get_environment_asset_by_id","parameters":[{"$ref":"#/components/parameters/IncludeUsageInfo"},{"$ref":"#/components/parameters/ComplyToProject"},{"$ref":"#/components/parameters/ComplyToWorkloadType"},{"$ref":"#/components/parameters/ComplyToReplicaType"},{"$ref":"#/components/parameters/IncludeStatus"}],"tags":["Environment"],"responses":{"200":{"description":"Request completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentAsset"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Update an environment asset.

> Use to update the details of environment asset by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Environment","description":"An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. \nIt exposes all the necessary tools (open source, 3rd party, or custom tools) along \nwith their connection interfaces including external node port and the container ports.\nYou can also specify a standard, distributed, or inference workload architecture for the environment.\nAn environment is a mandatory building block for the creation of a workload.\nFor more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"EnvironmentUpdateRequest":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetUpdateRequest"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"}}},"AssetUpdateRequest":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"}]},"AssetUpdatableFields":{"required":["name"],"properties":{"name":{"$ref":"#/components/schemas/AssetName"},"description":{"$ref":"#/components/schemas/AssetDescription"}}},"AssetName":{"description":"The name of the asset.","type":"string","minLength":1},"AssetDescription":{"description":"The description of the asset.","type":"string","minLength":1,"maxLength":250,"nullable":true},"EnvironmentAssetSpec":{"allOf":[{"$ref":"#/components/schemas/OverridableSpecFields"},{"$ref":"#/components/schemas/NonOverridableSpecFields"}]},"OverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerOverridable"},{"$ref":"#/components/schemas/CommonSecurityOverridable"},{"$ref":"#/components/schemas/EnvironmentVariablesAssetField"}]},"ContainerOverridable":{"description":"Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"command":{"description":"A command to the server as the entry point of the container running the workload.","type":"string","minLength":1,"nullable":true},"args":{"description":"Arguments to the command that the container running the workload executes.","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"CommonSecurityOverridable":{"description":"Security overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request.","properties":{"runAsUid":{"description":"The user id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsUid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"runAsGid":{"description":"The group id to run the entrypoint of the container which executes the workspace. Default to the value specified in the environment asset `runAsGid` field (optional). Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled.","type":"integer","format":"int64","nullable":true},"supplementalGroups":{"description":"Comma separated list of groups that the user running the container belongs to, in addition to the group indicated by runAsGid. Use only when the source uid/gid of the environment asset is not `fromTheImage`, and `overrideUidGidInWorkspace` is enabled. Using an empty string implies reverting the supplementary groups of the image.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablesAssetField":{"properties":{"environmentVariables":{"$ref":"#/components/schemas/EnvironmentVariablesOfAsset"}},"nullable":true,"type":"object"},"EnvironmentVariablesOfAsset":{"description":"Set of environment variables to populate into the container running the workspace.","type":"array","items":{"$ref":"#/components/schemas/EnvironmentVariableOfAsset"},"nullable":true},"EnvironmentVariableOfAsset":{"description":"Details of an environment variable which is populated into the container.","properties":{"name":{"description":"The name of the environment variable. (mandatory)","type":"string","minLength":1,"nullable":true},"value":{"description":"The value of the environment variable. (mutually exclusive with credential, configMap and podFieldRef)","type":"string","nullable":true},"credential":{"$ref":"#/components/schemas/EnvironmentVariableCredential"},"configMap":{"$ref":"#/components/schemas/EnvironmentVariableConfigMap"},"podFieldRef":{"$ref":"#/components/schemas/EnvironmentVariablePodFieldReference"},"exclude":{"description":"Use 'true' in case the environment variable is defined in defaults of the policy, and you wish to exclude it from the workload.","type":"boolean","nullable":true},"description":{"description":"Description of the environment variable.","type":"string","nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableCredential":{"description":"Details of the secret and key use to populate the environment variable. (mutually exclusive with value)","properties":{"assetId":{"description":"Unique identifier of the asset. (mandatory)","type":"string","minLength":1,"format":"uuid","nullable":true},"key":{"description":"The key in the secret resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariableConfigMap":{"description":"Details of the configMap and key use to populate the environment variable","properties":{"name":{"description":"The name of the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true},"key":{"description":"The key in the config-map resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"EnvironmentVariablePodFieldReference":{"description":"Details of the field-reference and key use to populate the environment variable","properties":{"path":{"description":"The field path resource. (mandatory)","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"NonOverridableSpecFields":{"allOf":[{"$ref":"#/components/schemas/ContainerNonOverridable"},{"$ref":"#/components/schemas/CommonSecurityNonOverridable"},{"$ref":"#/components/schemas/ContainerNonInferenceNonOverridable"},{"$ref":"#/components/schemas/NonInferenceSecurityNonOverridable"},{"properties":{"connections":{"description":"List of connections that either expose ports from the container (each port is associated with a tool that the container runs), or URL's to be used for connecting to an external tool that is related to the action of the container (such as Weights & Biases).","type":"array","items":{"$ref":"#/components/schemas/Connection"}},"overrideUidGidInWorkspace":{"description":"Allow specifying uid/gid as part of create workspace. This is relevant only for custom uigGidSource.","type":"boolean","default":false}}}]},"ContainerNonOverridable":{"description":"Container non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"image":{"description":"Docker image name. For more information, see [Images](https://kubernetes.io/docs/concepts/containers/images). The image name is mandatory for creating a workload.","type":"string","minLength":1,"nullable":true},"imagePullPolicy":{"$ref":"#/components/schemas/ImagePullPolicy"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime default will be used. This may be configured in the container image.","type":"string","minLength":1,"nullable":true},"createHomeDir":{"description":"When set to `true`, creates a home directory for the container.","type":"boolean","nullable":true},"probes":{"$ref":"#/components/schemas/Probes"}},"nullable":true,"type":"object"},"ImagePullPolicy":{"description":"Image pull policy. Defaults to `Always` if `:latest` tag is specified, otherwise it is `IfNotPresent`.","type":"string","minLength":1,"enum":["Always","Never","IfNotPresent"],"nullable":true},"Probes":{"description":"Probes are used to determine if the container is healthy and ready to accept traffic.","type":"object","properties":{"readiness":{"$ref":"#/components/schemas/Probe"}},"nullable":true},"Probe":{"type":"object","properties":{"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness or readiness probes are initiated.","type":"integer","format":"int32","minimum":0,"nullable":true},"periodSeconds":{"description":"How often (in seconds) to perform the probe.","type":"integer","format":"int32","minimum":1,"nullable":true},"timeoutSeconds":{"description":"Number of seconds after which the probe times out.","type":"integer","format":"int32","minimum":1,"nullable":true},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed.","type":"integer","format":"int32","minimum":1,"nullable":true},"failureThreshold":{"description":"When a probe fails, the number of times to try before giving up.","type":"integer","format":"int32","minimum":1,"nullable":true},"handler":{"$ref":"#/components/schemas/ProbeHandler"}},"nullable":true},"ProbeHandler":{"description":"The action taken to determine the health of the container. (mandatory)","type":"object","properties":{"httpGet":{"description":"An action based on HTTP Get requests.","type":"object","properties":{"path":{"description":"Path to access on the HTTP server, defaults to /.","type":"string","pattern":"^(\\x2F[a-zA-Z0-9\\-_.\\x2F]*)?$","nullable":true},"port":{"description":"Number of the port to access on the container.","type":"integer","format":"int32","minimum":1,"maximum":65535,"nullable":true},"host":{"description":"Host name to connect to, defaults to the pod IP.","type":"string","format":"hostname","nullable":true},"scheme":{"$ref":"#/components/schemas/ProbeHandlerScheme"}}}},"nullable":true},"ProbeHandlerScheme":{"description":"Scheme to use for connecting to the host, defaults to HTTP.","type":"string","enum":["HTTP","HTTPS"],"nullable":true},"CommonSecurityNonOverridable":{"description":"Security non overrideable fields. In the context of assets,these are environment asset fields that cannot be overriden in the submit workload request.","properties":{"uidGidSource":{"$ref":"#/components/schemas/UidGidSource"},"capabilities":{"description":"Add POSIX capabilities to running containers. Defaults to the default set of capabilities granted by the container runtime.","type":"array","items":{"$ref":"#/components/schemas/Capability"},"nullable":true},"seccompProfileType":{"$ref":"#/components/schemas/SeccompProfileType"},"runAsNonRoot":{"description":"Force the container to run as a non-root user.","type":"boolean","nullable":true},"readOnlyRootFilesystem":{"description":"If true, mounts the container's root filesystem as read-only.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"UidGidSource":{"description":"Indicate the way to determine the user and group ids of the container. The options are a. `fromTheImage` - user and group ids are determined by the docker image that the container runs. this is the default option. b. `custom` - user and group ids can be specified in the environment asset and/or the workload creation request. c. `idpToken` - user and group ids are determined according to the identity provider (idp) access token. This option is intended for internal use of the environment UI form. For more information, see [User Identity](https://run-ai-docs.nvidia.com/self-hosted/2.22/admin/runai-setup/config/non-root-containers/).","type":"string","enum":["fromTheImage","fromIdpToken","custom"],"nullable":true},"Capability":{"type":"string","enum":["AUDIT_CONTROL","AUDIT_READ","AUDIT_WRITE","BLOCK_SUSPEND","CHOWN","DAC_OVERRIDE","DAC_READ_SEARCH","FOWNER","FSETID","IPC_LOCK","IPC_OWNER","KILL","LEASE","LINUX_IMMUTABLE","MAC_ADMIN","MAC_OVERRIDE","MKNOD","NET_ADMIN","NET_BIND_SERVICE","NET_BROADCAST","NET_RAW","SETGID","SETFCAP","SETPCAP","SETUID","SYS_ADMIN","SYS_BOOT","SYS_CHROOT","SYS_MODULE","SYS_NICE","SYS_PACCT","SYS_PTRACE","SYS_RAWIO","SYS_RESOURCE","SYS_TIME","SYS_TTY_CONFIG","SYSLOG","WAKE_ALARM"]},"SeccompProfileType":{"description":"Indicates which kind of seccomp profile will be applied to the container. The options are a. `RuntimeDefault` - the container runtime default profile should be used. b. `Unconfined` - no profile should be applied. c. `Localhost` is not yet supported by Run:ai.","type":"string","enum":["RuntimeDefault","Unconfined","Localhost"],"nullable":true},"ContainerNonInferenceNonOverridable":{"description":"Container non Inference overrideable fields. It adds properties which are not allowed for Inference containers","properties":{"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.","type":"boolean","nullable":true},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"NonInferenceSecurityNonOverridable":{"description":"Security related fields. When used in assets context, those are environment asset fields that cannot be override in the submit workload request.","properties":{"allowPrivilegeEscalation":{"description":"Allow the container running the workload and all launched processes to gain additional privileges after the workload starts. For more information consult the User Identity in Container guide at https://docs.run.ai/admin/runai-setup/config/non-root-containers/","type":"boolean","nullable":true},"hostIpc":{"description":"Whether to enable host IPC. Defaults to false.","type":"boolean","nullable":true},"hostNetwork":{"description":"Whether to enable host networking. Default to false.","type":"boolean","nullable":true}},"nullable":true,"type":"object"},"Connection":{"required":["name"],"properties":{"name":{"description":"A unique name of this connection. This name correlates between the connection information specified at the environment asset, to the information about the connection as specified in SpecificEnv for a specific workspace.","type":"string","minLength":1},"isExternal":{"description":"Internal tools (isExternal=false) are tools that run as part of the container. External tools (isExternal=true) run outside the container, typically in the cloud.","type":"boolean","default":false},"internalToolInfo":{"$ref":"#/components/schemas/InternalToolInfo"},"externalToolInfo":{"$ref":"#/components/schemas/ExternalToolInfo"}}},"InternalToolInfo":{"description":"Information of the internal tool.","required":["toolType","connectionType","containerPort"],"properties":{"toolType":{"$ref":"#/components/schemas/InternalToolType"},"connectionType":{"$ref":"#/components/schemas/InternalConnectionType"},"containerPort":{"description":"The port within the container that the connection exposes.","type":"integer","format":"int32","minimum":1,"maximum":65535},"nodePortInfo":{"$ref":"#/components/schemas/NodePortInfo"},"externalUrlInfo":{"$ref":"#/components/schemas/ExternalUrlInfo"},"servingPortInfo":{"$ref":"#/components/schemas/ServingPortInfo"}},"nullable":true,"type":"object"},"InternalToolType":{"description":"The type of the internal tool. Internal tool runs within the container and exposes ports associated with the tool using NodePort, LoadBalancer or ExternalUrl.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","matlab","chatbot-ui"]},"InternalConnectionType":{"description":"The type of connection that exposes the container port.","type":"string","minLength":1,"enum":["LoadBalancer","NodePort","ExternalUrl","ServingPort"]},"NodePortInfo":{"properties":{"isCustomPort":{"description":"Whether the node port is provided in the specific env of the workspace. Default is false, and in this case the node port is auto generated by the system.","type":"boolean","default":false}},"nullable":true,"type":"object"},"ExternalUrlInfo":{"properties":{"isCustomUrl":{"description":"Whether external url is provided in the specific env of the workspace. Default is false, and in this case the external url is auto generated by the system.","type":"boolean","default":false},"externalUrl":{"description":"Default value for the external url. You can override it in the specific env of the workspace. Should be specified for ExternalUrl only.","type":"string","nullable":true,"minLength":1}},"nullable":true,"type":"object"},"ServingPortInfo":{"properties":{"protocol":{"type":"string","enum":["grpc","http"],"nullable":true}},"nullable":true,"type":"object"},"ExternalToolInfo":{"description":"Information of the external tool.","required":["toolType","externalUrl"],"properties":{"toolType":{"$ref":"#/components/schemas/ExternalToolType"},"externalUrl":{"description":"The external url for connecting to the external tool. The url can include environment variables that will be replaced with the value provided for those variables when the workspace is created.","type":"string","minLength":1}},"nullable":true,"type":"object"},"ExternalToolType":{"description":"The type of external tool that is associated with the connection. External tool typically runs in the cloud and require external url for connecting to it.","type":"string","minLength":1,"enum":["wandb","comet"]},"EnvironmentAsset":{"required":["meta","spec"],"properties":{"meta":{"$ref":"#/components/schemas/AssetMeta"},"spec":{"$ref":"#/components/schemas/EnvironmentAssetSpec"},"usedBy":{"$ref":"#/components/schemas/AssetUsageInfo"},"usageTimes":{"$ref":"#/components/schemas/UsageTimesInfo"},"compliance":{"$ref":"#/components/schemas/ComplianceInfo"},"status":{"$ref":"#/components/schemas/AssetClusterStatusInfo"}}},"AssetMeta":{"allOf":[{"$ref":"#/components/schemas/AssetUpdatableFields"},{"$ref":"#/components/schemas/AssetCreationFields"},{"$ref":"#/components/schemas/AssetReadOnlyFields"}]},"AssetCreationFields":{"type":"object","required":["scope"],"properties":{"scope":{"$ref":"#/components/schemas/Scope"},"clusterId":{"$ref":"#/components/schemas/ClusterIdOptional"},"departmentId":{"description":"The id of the department. Must be specified for department scoped assets.","type":"string","nullable":true,"minLength":1},"projectId":{"description":"The id of the project. Must be specified for project scoped assets.","type":"integer","format":"int32","nullable":true},"autoDelete":{"description":"The asset will be deleted automatically. This is intended for internal use.","type":"boolean","nullable":true,"default":false},"workloadSupportedTypes":{"$ref":"#/components/schemas/WorkloadSupportedTypes"}}},"Scope":{"description":"The scope in which an asset can be used. The highest scope, system, is intended for internal purposes only.","type":"string","minLength":1,"enum":["system","tenant","cluster","department","project"]},"ClusterIdOptional":{"description":"The id of the cluster.","type":"string","format":"uuid","minLength":1,"nullable":true},"WorkloadSupportedTypes":{"properties":{"inference":{"description":"Is inference a supported workload type.","type":"boolean","nullable":true},"workspace":{"description":"Is workspace a supported workload type.","type":"boolean","nullable":true},"training":{"description":"Is training a supported workload type.","type":"boolean","nullable":true},"distributed":{"description":"Is distributed a supported workload type.","type":"boolean","nullable":true},"distFramework":{"description":"The distributed training framework used in the workload.","type":"string","enum":["MPI","PyTorch","TF","XGBoost"],"nullable":true}},"nullable":true,"type":"object"},"AssetReadOnlyFields":{"required":["id","kind","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"kind":{"$ref":"#/components/schemas/AssetKind"},"tenantId":{"description":"The id of the tenant.","type":"integer","format":"int32","nullable":true},"createdBy":{"description":"The user who created the asset.","type":"string","minLength":1},"createdAt":{"description":"The time at which the asset were created","type":"string","minLength":1,"format":"date-time"},"updatedBy":{"description":"The user who updated the asset.","type":"string","minLength":1},"updatedAt":{"description":"The time at which the asset has been updated","type":"string","minLength":1,"format":"date-time"},"deletedAt":{"description":"Deletion time of the asset (relevant for assets that sync to the cluster)","type":"string","minLength":1,"format":"date-time"},"deletedBy":{"description":"The user who deleted the asset","type":"string","minLength":1},"projectName":{"description":"The name of the project that the asset is associated with, for project scoped assets.","type":"string","minLength":1,"nullable":true},"updateCount":{"$ref":"#/components/schemas/UpdateCount"}},"type":"object"},"AssetId":{"description":"Unique identifier of the asset.","type":"string","format":"uuid","minLength":1},"AssetKind":{"description":"The kind of the asset.","type":"string","minLength":1,"enum":["compute","environment","accessKey","dockerRegistry","password","genericSecret","registry","s3","git","nfs","pvc","hostPath","workload-template","model","config-map","secret-volume","data-volume"]},"UpdateCount":{"description":"the value of an update counter of a data in the system.","type":"integer","format":"int64"},"AssetUsageInfo":{"description":"Details about resources that use the asset.","properties":{"workspaces":{"description":"workspaces that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"trainings":{"description":"trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"distributed":{"description":"distributed trainings that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"inferences":{"description":"inferences that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/WorkloadRefAndStatus"}},"templates":{"description":"templates that rely on this asset.","type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"assets":{"description":"list of other assets that use this asset. specifically, accessKeys used by s3, and passwords used by git.","$ref":"#/components/schemas/AssetsUsageRef"}},"nullable":true,"type":"object"},"WorkloadRefAndStatus":{"description":"Id, name and status of a workspace or training","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/WorkloadId1"},"name":{"$ref":"#/components/schemas/WorkloadName"},"status":{"description":"The status of the workspace or training.","type":"string","minLength":1}}},"WorkloadId1":{"description":"A unique ID of the workload.","type":"string","format":"uuid"},"WorkloadName":{"description":"The name of the workload.","type":"string","minLength":1},"AssetRef":{"description":"Reference information about an asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"}}},"AssetsUsageRef":{"description":"Reference information about usage of assets by other assets, for example datasources that uses credentials.","properties":{"environment":{"nullable":true,"type":"object","description":"environment asset.","allOf":[{"$ref":"#/components/schemas/EnvironmentAssetRef"}],"deprecated":true},"environments":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"compute":{"$ref":"#/components/schemas/AssetsUsageRefCompute","deprecated":true},"computes":{"type":"array","items":{"$ref":"#/components/schemas/AssetRef"}},"datasources":{"type":"array","items":{"$ref":"#/components/schemas/AssetDatasourceRef"}}}},"EnvironmentAssetRef":{"description":"Reference information about environment asset.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"toolTypes":{"description":"the type of tools as defined in the connections of the environment asset.","type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ToolType"}}}},"ToolType":{"description":"Super set of Internal and External tool types.","type":"string","minLength":1,"enum":["jupyter-notebook","pycharm","visual-studio-code","tensorboard","rstudio","mlflow","custom","wandb","matlab","comet","chatbot-ui"]},"AssetsUsageRefCompute":{"allOf":[{"$ref":"#/components/schemas/AssetRef"}],"nullable":true,"type":"object"},"AssetDatasourceRef":{"description":"Reference information about a datasource asset.","required":["id","name","kind"],"properties":{"id":{"$ref":"#/components/schemas/AssetId"},"name":{"$ref":"#/components/schemas/AssetName"},"kind":{"$ref":"#/components/schemas/AssetKind"},"overrides":{"$ref":"#/components/schemas/DataSourceOverrides","deprecated":true}}},"DataSourceOverrides":{"description":"specific fields to override in the data source.","type":"object","nullable":true,"properties":{"containerPath":{"type":"string","minLength":1,"nullable":true}}},"UsageTimesInfo":{"description":"Details about times the asset has been used by workloads, etc.","properties":{"lastUsedByWorkload":{"description":"The time at which the asset were last used by a workload of given type and project. This field requires complyToProject and complyToWorkload types flags of the API, to specify the workload type and project id.","type":"string","minLength":1,"format":"date-time","nullable":true}},"nullable":true,"type":"object"},"ComplianceInfo":{"description":"Compliance of the asset with creation of workloads in the given project.","properties":{"imposed":{"description":"Whether the asset is imposed on created workloads by the administrator.","type":"boolean"},"compliance":{"description":"Whether the asset info complies with creation of workloads in the project.","type":"boolean"},"reason":{"description":"For asset that does not comply, specify one or more reason why.","type":"array","items":{"$ref":"#/components/schemas/ComplianceInfoReason"}}},"nullable":true,"type":"object"},"ComplianceInfoReason":{"description":"A reason explaining why the asset does not comply with workloads creation for a given project.","required":["details"],"properties":{"field":{"description":"for policy related issues, includes a json path to the field in the policy for which the message applies.","nullable":true,"type":"string"},"details":{"description":"explanation of the reason for rejecting the asset.","type":"string"}}},"AssetClusterStatusInfo":{"properties":{"status":{"$ref":"#/components/schemas/AssetSyncStatusEnum"},"issues":{"$ref":"#/components/schemas/AssetClusterStatusIssues"},"message":{"type":"string"},"url":{"type":"string"}},"nullable":true,"type":"object"},"AssetSyncStatusEnum":{"type":"string","enum":["Creating","Deleting","Failed","Deletion failed","Issues found","No issues found","No status","Updating"]},"AssetClusterStatusIssues":{"type":"array","items":{"$ref":"#/components/schemas/AssetClusterStatusIssue"}},"AssetClusterStatusIssue":{"type":"object","required":["scopeId","scopeType","issue"],"properties":{"scopeId":{"$ref":"#/components/schemas/ScopeId"},"scopeType":{"$ref":"#/components/schemas/ScopeType"},"issue":{"$ref":"#/components/schemas/AssetClusterStatusIssueEnum"}}},"ScopeId":{"type":"string","description":"The id of the cluster, department or project, depending on the scope type."},"ScopeType":{"type":"string","enum":["system","tenant","cluster","department","project"]},"AssetClusterStatusIssueEnum":{"type":"string","enum":["ReplicationError","LostPhase","NotCreated"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/asset/environment/{AssetId}":{"put":{"summary":"Update an environment asset.","description":"Use to update the details of environment asset by id.","operationId":"update_environment_asset_by_id","tags":["Environment"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentUpdateRequest"}}}},"responses":{"202":{"description":"Request accepted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentAsset"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"default":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Delete an environment asset.

> Use to delete an environment asset by id.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Environment","description":"An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. \nIt exposes all the necessary tools (open source, 3rd party, or custom tools) along \nwith their connection interfaces including external node port and the container ports.\nYou can also specify a standard, distributed, or inference workload architecture for the environment.\nAn environment is a mandatory building block for the creation of a workload.\nFor more information, see [Environments](https://run-ai-docs.nvidia.com/self-hosted/workloads-in-nvidia-run-ai/assets/environments).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"responses":{"202Accepted":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpResponse"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"HttpResponse":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/asset/environment/{AssetId}":{"delete":{"summary":"Delete an environment asset.","description":"Use to delete an environment asset by id.","operationId":"delete_environment_asset_by_id","tags":["Environment"],"responses":{"202":{"$ref":"#/components/responses/202Accepted"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
