CreateRuntime

Updated at:

Creates a runtime.

Operation description

Before you call this operation, make sure that you fully understand the billing methods and pricing of PAI-DSW.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

pailangstudio:CreateRuntime

create

*All Resource

*

None None

Request syntax

POST /api/v1/langstudio/runtimes HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

Accessibility

string

No

The visibility of the workspace. Valid values:

  • PRIVATE: visible only to you and administrators in this workspace

  • PUBLIC: visible to all users in this workspace

Valid values:

  • PUBLIC
  • PRIVATE

PRIVATE

WorkspaceId

string

No

The workspace ID. For more information about how to obtain the workspace ID, see ListWorkspaces.

174***

RuntimeName

string

No

The name of the runtime. Format requirements:

  • It can contain only letters, digits, and underscores (_).

  • It must start with a letter.

  • It must be 1 to 256 characters in length.

dev01

RuntimeType

string

No

The runtime type. Valid values:

  • DSW: PAI-DSW instance

Valid values:

  • DSW

DSW

EcsSpec

object

No

The ECS resource configuration.

InstanceType

string

No

The instance type.

ecs.c6.large

GPUType

string

No

The GPU type. Valid values:

  • V100

  • A100

  • T4

  • A10

  • P100

V100

CPU

integer

No

The number of vCPUs.

4

GPU

integer

No

The number of GPUs.

0

Memory

integer

No

The memory size. Unit: GB.

8

SharedMemory

integer

No

The shared memory size. Unit: GB.

8

Driver

string

No

The GPU driver version.

535.161.08

ResourceId

string

No

The resource quota ID.

quota18******zv9

UserVpc

object

No

The user VPC configuration.

VpcId

string

No

The VPC ID.

vpc-wz90****5v23

VSwitchId

string

No

The vSwitch ID.

vsw-wz9r****ng10

SecurityGroupId

string

No

The security group ID.

sg-wz9i****1129

DefaultRoute

string

No

The default route.

eth0

ExtendedCIDRs

array

No

The extended CIDR blocks.

string

No

The extended CIDR blocks.

172.16.1.0/24

Envs

array<object>

No

The environment variables.

object

No

Key

string

No

The environment variable key.

testKey1

Value

string

No

The environment variable value.

testValue1

Labels

array<object>

No

The labels.

object

No

Key

string

No

The label key.

testKey1

Value

string

No

The label value.

testValue1

DataSources

array<object>

No

The mounted data sources.

object

No

DatasetId

string

No

The dataset ID. This parameter and Uri are mutually exclusive.

d-umns******zij4szhc

Uri

string

No

The OSS path of the data source. This parameter and DatasetId are mutually exclusive.

oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/langstudio/source/

MountPath

string

No

The mount path.

/mnt/data

CredentialConfig

object

No

The credential configuration.

EnableCredentialInject

boolean

No

Specifies whether to enable credential injection.

true

AliyunEnvRoleKey

string

No

The environment variable role key.

0

CredentialConfigItems

array<object>

No

The list of credential configurations.

array<object>

No

Key

string

No

The key that identifies the configuration.

0

Type

string

No

The configuration type. Valid values:

  • Role: role assumption

  • RoleChain: role chain assumption

Role

Roles

array<object>

No

The list of configured roles.

object

No

The role information.

AssumeRoleFor

string

No

The principal on whose behalf the role is assumed.

1095******785714

RoleType

string

No

The type of the assumed role. Valid values:

  • service: assumed by a service

  • user: assumed by a regular user account

service

RoleArn

string

No

The role ARN.

acs:ram::1095******785714:role/testrole

RunTimeout

integer

No

The timeout period for a single test executed on the runtime. Unit: seconds.

180

WorkDir

string

No

The OSS path of the working directory.

oss://mybucket.oss-cn-hangzhou-internal.aliyuncs.com/workdir/

AutoUpdateImage

boolean

No

Specifies whether to automatically update the image. When a new image version is available, the system automatically updates the runtime image during off-peak hours.

Response elements

Element

Type

Description

Example

object

The response.

RuntimeId

string

The runtime ID.

rtime-apje******beaz

RequestId

string

The request ID.

963BD7F9-0C02-5594-9550-BCC6DD43E3C0

Examples

Success response

JSON format

{
  "RuntimeId": "rtime-apje******beaz",
  "RequestId": "963BD7F9-0C02-5594-9550-BCC6DD43E3C0"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.