Skip to content

Latest commit

 

History

History
1017 lines (798 loc) · 47.8 KB

ContainerGroupsService.md

File metadata and controls

1017 lines (798 loc) · 47.8 KB

ContainerGroupsService

A list of all methods in the ContainerGroupsService service. Click on the method name to view detailed information about that method.

Methods Description
listContainerGroups Gets the list of container groups
createContainerGroup Creates a new container group
getContainerGroup Gets a container group
updateContainerGroup Updates a container group
deleteContainerGroup Deletes a container group
startContainerGroup Starts a container group
stopContainerGroup Stops a container group
listContainerGroupInstances Gets the list of container group instances
getContainerGroupInstance Gets a container group instance
updateContainerGroupInstance Updates a container group instance
reallocateContainerGroupInstance Reallocates a container group instance to run on a different Salad Node
recreateContainerGroupInstance Stops a container, destroys it, and starts a new one without requiring the image to be downloaded again on a new Salad Node
restartContainerGroupInstance Stops a container and restarts it on the same Salad Node

listContainerGroups

Gets the list of container groups

  • HTTP Method: GET
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.

Return Type

ContainerGroupCollection

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.listContainerGroups('acme-corp', 'dev-env');

  console.log(data);
})();

createContainerGroup

Creates a new container group

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers

Parameters

Name Type Required Description
body ContainerGroupCreationRequest ✅ The request body.
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.

Return Type

ContainerGroup

Example Usage Code Snippet

import {
  AxiomLoggingConfiguration,
  ContainerConfiguration,
  ContainerConfigurationLogging,
  ContainerGroupCreationRequest,
  ContainerGroupGRpcProbe,
  ContainerGroupHttpProbeConfiguration,
  ContainerGroupLivenessProbe,
  ContainerGroupPriority,
  ContainerGroupProbeExec,
  ContainerGroupProbeHttpHeader,
  ContainerGroupQueueConnection,
  ContainerGroupReadinessProbe,
  ContainerGroupScalingAction,
  ContainerGroupStartupProbe,
  ContainerGroupTcpProbe,
  ContainerLoggingConfigurationHttp2,
  ContainerLoggingHttpCompression,
  ContainerLoggingHttpFormat,
  ContainerLoggingHttpHeader,
  ContainerLoggingSplunkConfiguration,
  ContainerNetworkingProtocol,
  ContainerRegistryAuthentication,
  ContainerRegistryAuthenticationAwsEcr,
  ContainerRegistryAuthenticationBasic,
  ContainerRegistryAuthenticationDockerHub,
  ContainerRegistryAuthenticationGcpGar,
  ContainerRegistryAuthenticationGcpGcr,
  ContainerRestartPolicy,
  CountryCode,
  CreateContainerGroupNetworking,
  CreateContainerResourceRequirements,
  DatadogLoggingConfiguration,
  DatadogTagForContainerLogging,
  HttpScheme,
  NewRelicLoggingConfiguration,
  QueueBasedAutoscalerConfiguration,
  SaladCloudSdk,
  TcpLoggingConfiguration,
  TheContainerGroupNetworkingLoadBalancer,
} from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const axiomLoggingConfiguration: AxiomLoggingConfiguration = {
    apiToken: 'api_token',
    dataset: 'dataset',
    host: 'host',
  };

  const datadogTagForContainerLogging: DatadogTagForContainerLogging = {
    name: 'name',
    value: 'value',
  };

  const datadogLoggingConfiguration: DatadogLoggingConfiguration = {
    apiKey: 'api_key',
    host: 'host',
    tags: [datadogTagForContainerLogging],
  };

  const containerLoggingHttpCompression = ContainerLoggingHttpCompression.NONE;

  const containerLoggingHttpFormat = ContainerLoggingHttpFormat.JSON;

  const containerLoggingHttpHeader: ContainerLoggingHttpHeader = {
    name: 'name',
    value: 'value',
  };

  const containerLoggingConfigurationHttp2: ContainerLoggingConfigurationHttp2 = {
    compression: containerLoggingHttpCompression,
    format: containerLoggingHttpFormat,
    headers: [containerLoggingHttpHeader],
    host: 'host',
    password: 'password',
    path: 'path',
    port: 42056,
    user: 'user',
  };

  const newRelicLoggingConfiguration: NewRelicLoggingConfiguration = {
    host: 'host',
    ingestionKey: 'ingestion_key',
  };

  const containerLoggingSplunkConfiguration: ContainerLoggingSplunkConfiguration = {
    host: 'host',
    token: 'token',
  };

  const tcpLoggingConfiguration: TcpLoggingConfiguration = {
    host: 'host',
    port: 44671,
  };

  const containerConfigurationLogging: ContainerConfigurationLogging = {
    axiom: axiomLoggingConfiguration,
    datadog: datadogLoggingConfiguration,
    http: containerLoggingConfigurationHttp2,
    newRelic: newRelicLoggingConfiguration,
    splunk: containerLoggingSplunkConfiguration,
    tcp: tcpLoggingConfiguration,
  };

  const containerGroupPriority = ContainerGroupPriority.HIGH;

  const containerRegistryAuthenticationAwsEcr: ContainerRegistryAuthenticationAwsEcr = {
    accessKeyId: 'access_key_id',
    secretAccessKey: 'secret_access_key',
  };

  const containerRegistryAuthenticationBasic: ContainerRegistryAuthenticationBasic = {
    password: 'password',
    username: 'username',
  };

  const containerRegistryAuthenticationDockerHub: ContainerRegistryAuthenticationDockerHub = {
    personalAccessToken: 'personal_access_token',
    username: 'username',
  };

  const containerRegistryAuthenticationGcpGar: ContainerRegistryAuthenticationGcpGar = {
    serviceKey: 'service_key',
  };

  const containerRegistryAuthenticationGcpGcr: ContainerRegistryAuthenticationGcpGcr = {
    serviceKey: 'service_key',
  };

  const containerRegistryAuthentication: ContainerRegistryAuthentication = {
    awsEcr: containerRegistryAuthenticationAwsEcr,
    basic: containerRegistryAuthenticationBasic,
    dockerHub: containerRegistryAuthenticationDockerHub,
    gcpGar: containerRegistryAuthenticationGcpGar,
    gcpGcr: containerRegistryAuthenticationGcpGcr,
  };

  const createContainerResourceRequirements: CreateContainerResourceRequirements = {
    cpu: 827,
    gpuClasses: ['gpu_classes'],
    memory: 734164836,
    shmSize: 64,
    storageAmount: 761306530849177.9,
  };

  const containerConfiguration: ContainerConfiguration = {
    command: ['command'],
    environmentVariables: [],
    image: 'acme/:latest',
    imageCaching: true,
    logging: containerConfigurationLogging,
    priority: containerGroupPriority,
    registryAuthentication: containerRegistryAuthentication,
    resources: createContainerResourceRequirements,
  };

  const countryCode = CountryCode.AF;

  const containerGroupProbeExec: ContainerGroupProbeExec = {
    command: ['command'],
  };

  const containerGroupGRpcProbe: ContainerGroupGRpcProbe = {
    port: 37648,
    service: 'service',
  };

  const containerGroupProbeHttpHeader: ContainerGroupProbeHttpHeader = {
    name: 'name',
    value: 'value',
  };

  const httpScheme = HttpScheme.HTTP;

  const containerGroupHttpProbeConfiguration: ContainerGroupHttpProbeConfiguration = {
    headers: [containerGroupProbeHttpHeader],
    path: 'path',
    port: 29069,
    scheme: httpScheme,
  };

  const containerGroupTcpProbe: ContainerGroupTcpProbe = {
    port: 13817,
  };

  const containerGroupLivenessProbe: ContainerGroupLivenessProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 3,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 670,
    periodSeconds: 10,
    successThreshold: 1,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 30,
  };

  const theContainerGroupNetworkingLoadBalancer = TheContainerGroupNetworkingLoadBalancer.ROUND_ROBIN;

  const containerNetworkingProtocol = ContainerNetworkingProtocol.HTTP;

  const createContainerGroupNetworking: CreateContainerGroupNetworking = {
    auth: true,
    clientRequestTimeout: 100000,
    loadBalancer: theContainerGroupNetworkingLoadBalancer,
    port: 60000,
    protocol: containerNetworkingProtocol,
    serverResponseTimeout: 100000,
    singleConnectionLimit: true,
  };

  const queueBasedAutoscalerConfiguration: QueueBasedAutoscalerConfiguration = {
    desiredQueueLength: 53,
    maxDownscalePerMinute: 59,
    maxReplicas: 321,
    maxUpscalePerMinute: 100,
    minReplicas: 54,
    pollingPeriod: 140,
  };

  const containerGroupQueueConnection: ContainerGroupQueueConnection = {
    path: 'path',
    port: 47568,
    queueName: 'z1h-3z01x9',
  };

  const containerGroupReadinessProbe: ContainerGroupReadinessProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 3,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 262,
    periodSeconds: 1,
    successThreshold: 1,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 1,
  };

  const containerRestartPolicy = ContainerRestartPolicy.ALWAYS;

  const containerGroupScalingAction: ContainerGroupScalingAction = {
    replicas: 461,
    schedule: '7kwC/T8C   da       x6Ci   bM-rgGYn     bDY6,vT',
  };

  const containerGroupStartupProbe: ContainerGroupStartupProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 15,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 503,
    periodSeconds: 3,
    successThreshold: 2,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 10,
  };

  const containerGroupCreationRequest: ContainerGroupCreationRequest = {
    autostartPolicy: true,
    container: containerConfiguration,
    countryCodes: [countryCode],
    displayName: 'KMg0KyVwpb',
    livenessProbe: containerGroupLivenessProbe,
    name: 'name',
    networking: createContainerGroupNetworking,
    queueAutoscaler: queueBasedAutoscalerConfiguration,
    queueConnection: containerGroupQueueConnection,
    readinessProbe: containerGroupReadinessProbe,
    replicas: 77,
    restartPolicy: containerRestartPolicy,
    scalingActions: [containerGroupScalingAction],
    scheduledScalingEnabled: true,
    startupProbe: containerGroupStartupProbe,
  };

  const { data } = await saladCloudSdk.containerGroups.createContainerGroup(
    'acme-corp',
    'dev-env',
    containerGroupCreationRequest,
  );

  console.log(data);
})();

getContainerGroup

Gets a container group

  • HTTP Method: GET
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Return Type

ContainerGroup

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.getContainerGroup('acme-corp', 'dev-env', 'mandlebrot');

  console.log(data);
})();

updateContainerGroup

Updates a container group

  • HTTP Method: PATCH
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}

Parameters

Name Type Required Description
body ContainerGroupPatch ✅ The request body.
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Return Type

ContainerGroup

Example Usage Code Snippet

import {
  AxiomLoggingConfiguration,
  ContainerGroupGRpcProbe,
  ContainerGroupHttpProbeConfiguration,
  ContainerGroupLivenessProbe,
  ContainerGroupPatch,
  ContainerGroupPriority,
  ContainerGroupProbeExec,
  ContainerGroupProbeHttpHeader,
  ContainerGroupReadinessProbe,
  ContainerGroupScalingAction,
  ContainerGroupStartupProbe,
  ContainerGroupTcpProbe,
  ContainerLoggingConfigurationHttp1,
  ContainerLoggingHttpCompression,
  ContainerLoggingHttpFormat,
  ContainerLoggingHttpHeader,
  ContainerLoggingSplunkConfiguration,
  ContainerRegistryAuthentication,
  ContainerRegistryAuthenticationAwsEcr,
  ContainerRegistryAuthenticationBasic,
  ContainerRegistryAuthenticationDockerHub,
  ContainerRegistryAuthenticationGcpGar,
  ContainerRegistryAuthenticationGcpGcr,
  ContainerResourceUpdateSchema,
  CountryCode,
  DatadogLoggingConfiguration,
  DatadogTagForContainerLogging,
  HttpScheme,
  NewRelicLoggingConfiguration,
  QueueBasedAutoscalerConfiguration,
  SaladCloudSdk,
  TcpLoggingConfiguration,
  UpdateContainer,
  UpdateContainerGroupNetworking,
  UpdateContainerLogging,
} from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const axiomLoggingConfiguration: AxiomLoggingConfiguration = {
    apiToken: 'api_token',
    dataset: 'dataset',
    host: 'host',
  };

  const datadogTagForContainerLogging: DatadogTagForContainerLogging = {
    name: 'name',
    value: 'value',
  };

  const datadogLoggingConfiguration: DatadogLoggingConfiguration = {
    apiKey: 'api_key',
    host: 'host',
    tags: [datadogTagForContainerLogging],
  };

  const containerLoggingHttpCompression = ContainerLoggingHttpCompression.NONE;

  const containerLoggingHttpFormat = ContainerLoggingHttpFormat.JSON;

  const containerLoggingHttpHeader: ContainerLoggingHttpHeader = {
    name: 'name',
    value: 'value',
  };

  const containerLoggingConfigurationHttp1: ContainerLoggingConfigurationHttp1 = {
    compression: containerLoggingHttpCompression,
    format: containerLoggingHttpFormat,
    headers: [containerLoggingHttpHeader],
    host: 'host',
    password: 'password',
    path: 'path',
    port: 55354,
    user: 'user',
  };

  const newRelicLoggingConfiguration: NewRelicLoggingConfiguration = {
    host: 'host',
    ingestionKey: 'ingestion_key',
  };

  const containerLoggingSplunkConfiguration: ContainerLoggingSplunkConfiguration = {
    host: 'host',
    token: 'token',
  };

  const tcpLoggingConfiguration: TcpLoggingConfiguration = {
    host: 'host',
    port: 44671,
  };

  const updateContainerLogging: UpdateContainerLogging = {
    axiom: axiomLoggingConfiguration,
    datadog: datadogLoggingConfiguration,
    http: containerLoggingConfigurationHttp1,
    newRelic: newRelicLoggingConfiguration,
    splunk: containerLoggingSplunkConfiguration,
    tcp: tcpLoggingConfiguration,
  };

  const containerGroupPriority = ContainerGroupPriority.HIGH;

  const containerRegistryAuthenticationAwsEcr: ContainerRegistryAuthenticationAwsEcr = {
    accessKeyId: 'access_key_id',
    secretAccessKey: 'secret_access_key',
  };

  const containerRegistryAuthenticationBasic: ContainerRegistryAuthenticationBasic = {
    password: 'password',
    username: 'username',
  };

  const containerRegistryAuthenticationDockerHub: ContainerRegistryAuthenticationDockerHub = {
    personalAccessToken: 'personal_access_token',
    username: 'username',
  };

  const containerRegistryAuthenticationGcpGar: ContainerRegistryAuthenticationGcpGar = {
    serviceKey: 'service_key',
  };

  const containerRegistryAuthenticationGcpGcr: ContainerRegistryAuthenticationGcpGcr = {
    serviceKey: 'service_key',
  };

  const containerRegistryAuthentication: ContainerRegistryAuthentication = {
    awsEcr: containerRegistryAuthenticationAwsEcr,
    basic: containerRegistryAuthenticationBasic,
    dockerHub: containerRegistryAuthenticationDockerHub,
    gcpGar: containerRegistryAuthenticationGcpGar,
    gcpGcr: containerRegistryAuthenticationGcpGcr,
  };

  const containerResourceUpdateSchema: ContainerResourceUpdateSchema = {
    cpu: 191,
    gpuClasses: ['gpu_classes'],
    memory: 909130690,
    shmSize: 64,
    storageAmount: 699558298076245,
  };

  const updateContainer: UpdateContainer = {
    command: ['command'],
    environmentVariables: [],
    image: 'image',
    imageCaching: true,
    logging: updateContainerLogging,
    priority: containerGroupPriority,
    registryAuthentication: containerRegistryAuthentication,
    resources: containerResourceUpdateSchema,
  };

  const countryCode = CountryCode.AF;

  const containerGroupProbeExec: ContainerGroupProbeExec = {
    command: ['command'],
  };

  const containerGroupGRpcProbe: ContainerGroupGRpcProbe = {
    port: 37648,
    service: 'service',
  };

  const containerGroupProbeHttpHeader: ContainerGroupProbeHttpHeader = {
    name: 'name',
    value: 'value',
  };

  const httpScheme = HttpScheme.HTTP;

  const containerGroupHttpProbeConfiguration: ContainerGroupHttpProbeConfiguration = {
    headers: [containerGroupProbeHttpHeader],
    path: 'path',
    port: 29069,
    scheme: httpScheme,
  };

  const containerGroupTcpProbe: ContainerGroupTcpProbe = {
    port: 13817,
  };

  const containerGroupLivenessProbe: ContainerGroupLivenessProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 3,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 670,
    periodSeconds: 10,
    successThreshold: 1,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 30,
  };

  const updateContainerGroupNetworking: UpdateContainerGroupNetworking = {
    port: 17025,
  };

  const queueBasedAutoscalerConfiguration: QueueBasedAutoscalerConfiguration = {
    desiredQueueLength: 53,
    maxDownscalePerMinute: 59,
    maxReplicas: 321,
    maxUpscalePerMinute: 100,
    minReplicas: 54,
    pollingPeriod: 140,
  };

  const containerGroupReadinessProbe: ContainerGroupReadinessProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 3,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 262,
    periodSeconds: 1,
    successThreshold: 1,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 1,
  };

  const containerGroupScalingAction: ContainerGroupScalingAction = {
    replicas: 461,
    schedule: '7kwC/T8C   da       x6Ci   bM-rgGYn     bDY6,vT',
  };

  const containerGroupStartupProbe: ContainerGroupStartupProbe = {
    exec: containerGroupProbeExec,
    failureThreshold: 15,
    grpc: containerGroupGRpcProbe,
    http: containerGroupHttpProbeConfiguration,
    initialDelaySeconds: 503,
    periodSeconds: 3,
    successThreshold: 2,
    tcp: containerGroupTcpProbe,
    timeoutSeconds: 10,
  };

  const containerGroupPatch: ContainerGroupPatch = {
    container: updateContainer,
    countryCodes: [countryCode],
    displayName: 'ykW8yoj HBQ',
    livenessProbe: containerGroupLivenessProbe,
    networking: updateContainerGroupNetworking,
    queueAutoscaler: queueBasedAutoscalerConfiguration,
    readinessProbe: containerGroupReadinessProbe,
    replicas: 102,
    scalingActions: [containerGroupScalingAction],
    scheduledScalingEnabled: true,
    startupProbe: containerGroupStartupProbe,
  };

  const { data } = await saladCloudSdk.containerGroups.updateContainerGroup(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    containerGroupPatch,
  );

  console.log(data);
})();

deleteContainerGroup

Deletes a container group

  • HTTP Method: DELETE
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.deleteContainerGroup('acme-corp', 'dev-env', 'mandlebrot');

  console.log(data);
})();

startContainerGroup

Starts a container group

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/start

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.startContainerGroup('acme-corp', 'dev-env', 'mandlebrot');

  console.log(data);
})();

stopContainerGroup

Stops a container group

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/stop

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.stopContainerGroup('acme-corp', 'dev-env', 'mandlebrot');

  console.log(data);
})();

listContainerGroupInstances

Gets the list of container group instances

  • HTTP Method: GET
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name

Return Type

ContainerGroupInstanceCollection

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.listContainerGroupInstances(
    'acme-corp',
    'dev-env',
    'mandlebrot',
  );

  console.log(data);
})();

getContainerGroupInstance

Gets a container group instance

  • HTTP Method: GET
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name
containerGroupInstanceId string ✅ The unique container group instance identifier

Return Type

ContainerGroupInstance

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.getContainerGroupInstance(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    'db3a4591-efc3-46c0-b06a-3d820c0ec100',
  );

  console.log(data);
})();

updateContainerGroupInstance

Updates a container group instance

  • HTTP Method: PATCH
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}

Parameters

Name Type Required Description
body ContainerGroupInstancePatch ✅ The request body.
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name
containerGroupInstanceId string ✅ The unique container group instance identifier

Return Type

ContainerGroupInstance

Example Usage Code Snippet

import { ContainerGroupInstancePatch, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const containerGroupInstancePatch: ContainerGroupInstancePatch = {
    deletionCost: 19725,
  };

  const { data } = await saladCloudSdk.containerGroups.updateContainerGroupInstance(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    'db3a4591-efc3-46c0-b06a-3d820c0ec100',
    containerGroupInstancePatch,
  );

  console.log(data);
})();

reallocateContainerGroupInstance

Reallocates a container group instance to run on a different Salad Node

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/reallocate

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name
containerGroupInstanceId string ✅ The unique container group instance identifier

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.reallocateContainerGroupInstance(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    'db3a4591-efc3-46c0-b06a-3d820c0ec100',
  );

  console.log(data);
})();

recreateContainerGroupInstance

Stops a container, destroys it, and starts a new one without requiring the image to be downloaded again on a new Salad Node

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/recreate

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name
containerGroupInstanceId string ✅ The unique container group instance identifier

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.recreateContainerGroupInstance(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    'db3a4591-efc3-46c0-b06a-3d820c0ec100',
  );

  console.log(data);
})();

restartContainerGroupInstance

Stops a container and restarts it on the same Salad Node

  • HTTP Method: POST
  • Endpoint: /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/restart

Parameters

Name Type Required Description
organizationName string ✅ Your organization name. This identifies the billing context for the API operation and represents a security boundary for SaladCloud resources. The organization must be created before using the API, and you must be a member of the organization.
projectName string ✅ Your project name. This represents a collection of related SaladCloud resources. The project must be created before using the API.
containerGroupName string ✅ The unique container group name
containerGroupInstanceId string ✅ The unique container group instance identifier

Example Usage Code Snippet

import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk';

(async () => {
  const saladCloudSdk = new SaladCloudSdk({
    apiKey: 'YOUR_API_KEY',
  });

  const { data } = await saladCloudSdk.containerGroups.restartContainerGroupInstance(
    'acme-corp',
    'dev-env',
    'mandlebrot',
    'db3a4591-efc3-46c0-b06a-3d820c0ec100',
  );

  console.log(data);
})();