Class: Anthropic::Resources::Beta::Deployments

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/deployments.rb,
sig/anthropic/resources/beta/deployments.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Deployments

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Deployments.

Parameters:



311
312
313
# File 'lib/anthropic/resources/beta/deployments.rb', line 311

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(deployment_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Archive Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentArchiveParams for more details.

Parameters:

  • deployment_id (String)

    Path parameter deployment_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



210
211
212
213
214
215
216
217
218
219
# File 'lib/anthropic/resources/beta/deployments.rb', line 210

def archive(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentArchiveParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/deployments/%1$s/archive?beta=true", deployment_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#create(agent:, environment_id:, initial_events:, name:, budget: nil, description: nil, metadata: nil, resources: nil, schedule: nil, vault_ids: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Create Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentCreateParams for more details.

Parameters:

Returns:

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/anthropic/resources/beta/deployments.rb', line 43

def create(params)
  parsed, options = Anthropic::Beta::DeploymentCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"}
  @client.request(
    method: :post,
    path: "v1/deployments?beta=true",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#list(agent_id: nil, created_at_gte: nil, created_at_lte: nil, include_archived: nil, limit: nil, page: nil, status: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaManagedAgentsDeployment>

List Deployments

Some parameter documentations has been truncated, see Models::Beta::DeploymentListParams for more details.

Parameters:

  • agent_id (String)

    Query param: Filter by agent ID.

  • created_at_gte (Time)

    Query param: Return deployments created at or after this time (inclusive).

  • created_at_lte (Time)

    Query param: Return deployments created at or before this time (inclusive).

  • include_archived (Boolean)

    Query param: When true, includes archived deployments. Default: false (exclude a

  • limit (Integer)

    Query param: Maximum results per page. Default 20, maximum 100.

  • page (String)

    Query param: Opaque pagination cursor.

  • status (Symbol, Anthropic::Models::Beta::BetaManagedAgentsDeploymentStatus)

    Query param: Filter by status: active or paused. Omit for both. To include a

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Header param: Optional header to select the Workspace for this request. The valu

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/anthropic/resources/beta/deployments.rb', line 166

def list(params = {})
  query_params = [
    :agent_id,
    :created_at_gte,
    :created_at_lte,
    :include_archived,
    :limit,
    :page,
    :status
  ]
  parsed, options = Anthropic::Beta::DeploymentListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: "v1/deployments?beta=true",
    query: query.transform_keys(created_at_gte: "created_at[gte]", created_at_lte: "created_at[lte]"),
    headers: parsed.except(*query_params).transform_keys(
      betas: "anthropic-beta",
      workspace_id: "anthropic-workspace-id"
    ),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#pause(deployment_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Pause Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentPauseParams for more details.

Parameters:

  • deployment_id (String)

    Path parameter deployment_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



239
240
241
242
243
244
245
246
247
248
# File 'lib/anthropic/resources/beta/deployments.rb', line 239

def pause(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentPauseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/deployments/%1$s/pause?beta=true", deployment_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#retrieve(deployment_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Get Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentRetrieveParams for more details.

Parameters:

  • deployment_id (String)

    Path parameter deployment_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
# File 'lib/anthropic/resources/beta/deployments.rb', line 74

def retrieve(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/deployments/%1$s?beta=true", deployment_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#run(deployment_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeploymentRun

Run Deployment Now

Some parameter documentations has been truncated, see Models::Beta::DeploymentRunParams for more details.

Parameters:

  • deployment_id (String)

    Path parameter deployment_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



268
269
270
271
272
273
274
275
276
277
# File 'lib/anthropic/resources/beta/deployments.rb', line 268

def run(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentRunParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/deployments/%1$s/run?beta=true", deployment_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaManagedAgentsDeploymentRun,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#unpause(deployment_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Unpause Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentUnpauseParams for more details.

Parameters:

  • deployment_id (String)

    Path parameter deployment_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



297
298
299
300
301
302
303
304
305
306
# File 'lib/anthropic/resources/beta/deployments.rb', line 297

def unpause(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentUnpauseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/deployments/%1$s/unpause?beta=true", deployment_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end

#update(deployment_id, agent: nil, budget: nil, description: nil, environment_id: nil, initial_events: nil, metadata: nil, name: nil, resources: nil, schedule: nil, vault_ids: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaManagedAgentsDeployment

Update Deployment

Some parameter documentations has been truncated, see Models::Beta::DeploymentUpdateParams for more details.

Parameters:

Returns:

See Also:



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/anthropic/resources/beta/deployments.rb', line 123

def update(deployment_id, params = {})
  parsed, options = Anthropic::Beta::DeploymentUpdateParams.dump_request(params)
  header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"}
  @client.request(
    method: :post,
    path: ["v1/deployments/%1$s?beta=true", deployment_id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::BetaManagedAgentsDeployment,
    options: {extra_headers: {"anthropic-beta" => "managed-agents-2026-04-01"}, **options}
  )
end