ilija-test-compute
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Spheron

Compute SDK

This package provides support for working with Spheron Compute organization.

Usage

The package exports SpheronClient class, which includes methods for working with clusters, marketplace apps, cluster instances and their configurations. The constructor of SpheronClient takes in one parameter token. Check the Access Token section for information on how to create a token.

import SpheronClient from "@spheron/compute";
...
const client = new SpheronClient({ token });
await client.instance.create(
    clusterName: clusterName,
    configuration: {
      image: dockerImage,
      tag: dockerImageTag,
      instanceCount: numberOfInstances,
      ports: [{ containerPort: containerPort, exposedPort: exposedPort }],
      env: [{ key:"key", value: "value", isSecret: isSecret }],
      commands: [],
      args: [],
      region: deployRegion,
      machineImageName: computeMachineName,
    },
    healthCheckConfig: {
      path: healthCheckPath,
      port: healthCheckPort,
    },
  }
);

For more information about the Compute methods, check out the DOCS

Access Token

To create the token that is used with the SpheronClient, follow the instructions in the DOCS. When you are creating the tokens, please choose compute type in the dashboard.

Learn More

You can learn more about Spheron and Compute SDK here:

Package Sidebar

Install

npm i ilija-test-compute

Weekly Downloads

0

Version

1.0.1

License

Apache-2.0

Unpacked Size

444 kB

Total Files

4

Last publish

Collaborators

  • ilij4