{
"info": {
"author": "Spotinst",
"author_email": "service@spotinst.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "[](https://travis-ci.org/spotinst/spotinst-sdk-python)\n[](https://coveralls.io/github/spotinst/spotinst-sdk-python?branch=master)\n[](https://www.python.org/downloads/release/python-270/)\n[](https://www.python.org/downloads/release/python-360/)\n\n# spotinst-sdk-python\nSpotinst SDK for the Python programming language\n\n## Breaking Change: Version 2.x.x\n\nThe new Spotinst Python SDK comes with a few breaking changes but do not fear, here we will explain all you need to know to make sure you can go right back in buisness in no time. \n\n * There is no longer the `SpotinstClient()` class which was used to validate your credentials and make requests all in one\n * Now there is the `SpotinstSession()` class which is used to validate credentials. [Configure Session Docs](#Configuring-Session)\n * From the session object you can create client objects which correlate to specific Spotinst Services and are used to make requests. [Setup Clients Docs](#Setup-Clients)\n * Some methods required you to pass in a Model object\n\nHere is a basic example of how to create an Ocean cluster using the Ocean Client and the Ocean Models\n\n```python\nfrom spotinst_sdk import SpotinstSession\nfrom spotinst_sdk.models.ocean.aws import *\n\nsession = SpotinstSession()\nclient = session.client(\"ocean_aws\")\n\n################ Compute ################\nlaunch_specification = LaunchSpecifications(security_group_ids=[\"sg-12345\"],\n image_id=\"ami-12345\", key_pair=\"Noam-key\")\n\ninstance_types = InstanceTypes(whitelist=[\"c4.8xlarge\"])\n\ncompute = Compute(instance_types=instance_types, \n subnet_ids=[\"subnet-1234\"], launch_specification=launch_specification)\n\n################ Strategy ################\n\nstrategy = Strategy(utilize_reserved_instances=False, fallback_to_od=True, spot_percentage=100)\n\n################ Capacity ################\n\ncapacity = Capacity(minimum=0, maximum=0, target=0)\n\n################# Ocean #################\n\nocean = Ocean(name=\"Ocean SDK Test\", controller_cluster_id=\"ocean.k8s\", \n region=\"us-west-2\", capacity=capacity, strategy=strategy, compute=compute)\n\nclient.create_ocean_cluster(ocean=ocean)\n```\n\nIn the [SDK Client documentation](./docs/pydocmd/clients/) you can view what methods are supported by each client.
\nFor information on what models are supported checkout the [SDK Model documentation](./docs/pydocmd/models/).
\nMore examples can be found in the [SDK Examples Documentation](./docs/pydocmd/examples/).
\n\n## Table of contents\n\n * [Installation](#installation)\n * [Configuring Session](#configuring-session)\n * [Setup Clients](#setup-clients)\n * [SDK Docs](./docs/pydocmd/)\n * [Examples](./docs/pydocmd/examples/)\n * [Clients](./docs/pydocmd/clients/)\n * [Administration](./docs/pydocmd/clients/admin/)\n * [Elastigroup](./docs/pydocmd/clients/elastigroup/)\n * [Functions](./docs/pydocmd/clients/functions/)\n * [MCS](./docs/pydocmd/clients/mcs/)\n * [MLB](./docs/pydocmd/clients/mlb/)\n * [MrScaler](./docs/pydocmd/clients/mrscaler/)\n * [Ocean](./docs/pydocmd/clients/ocean/)\n * [Subscription](./docs/pydocmd/clients/subscription/)\n * [Models](./docs/pydocmd/models/)\n * [Administration](./docs/pydocmd/models/admin.md)\n * [Elasitgroups](./docs/pydocmd/models/elastigroup/)\n * [Functions](./docs/pydocmd/models/functions.md)\n * [MLB](./docs/pydocmd/models/mlb.md)\n * [MrScalers](./docs/pydocmd/models/mrscaler/)\n * [Oceans](./docs/pydocmd/models/ocean/)\n * [Subscription](./docs/pydocmd/models/subscription.md)\n\n\n## Installation\n```bash\npip install --upgrade spotinst-sdk\n```\n\n## Configuring Session\nThe mechanism in which the sdk looks for credentials is to search through a list of possible locations and stop as soon as it finds credentials. \nThe order in which the sdk searches for credentials is:\n 1. Passing credentials as parameters to the `SpotinstSession()` constructor\n- example\n```python\nsession = SpotinstSession(auth_token='token', account_id='act-123')\n```\n\n 2. Fetching the account and token from environment variables under `SPOTINST_ACCOUNT` & `SPOTINST_TOKEN`\n\nIf you choose to not pass your credentials directly you configure a credentials file, this file should be a valid `.yml` file.\nThe default shared credential file location is `~/.spotinst/credentials` and the default profile is `default`\n- example\n```yaml\ndefault: #profile\n token: $defaul_spotinst_token\n account: $default_spotinst-account-id\nmy_profle:\n token: $my_spotinst_token\n account: $my_spotinst-account-id\n```\n\n 3. You can overwrite the credentials file location and the profile used as parameters in the `SpotinstSession()` constructor\n- example\n```python\nsession = SpotinstSession(credentials_file='/path/to/file', profile='my_profile')\n```\n \n 4. You can overwrite the credentials file location and the profile used as environment variables `SPOTINST_PROFILE` and/or `SPOTINST_SHARED_CREDENTIALS_FILE`\n 5. Fetching from the default location with the default profile\n \n## Setup Clients\nAfter a session is created you can use the session object to create clients. Clients are used to make request to the different services that Spotinsts has to offer. To create a client simply use the method `client` from the session object and pass in the string of the client you wish to create. Here is an example:\n\n```python\nsession = SpotinstSession()\n\neg_client = session.client(\"elastigroup_aws\")\nocean_client = session.client(\"ocean\")\n```\n\nTake note you can create more than one client with the session. The currently supported clients are\n\n### Client Options:\n * `session.client(\"admin\")`\n * `session.client(\"elastigroup_aws\")`\n * `session.client(\"elastigroup_azure\")`\n * `session.client(\"elastigroup_gcp\")`\n * `session.client(\"functions\")`\n * `session.client(\"mcs\")`\n * `session.client(\"mlb\")`\n * `session.client(\"mrScaler_aws\")`\n * `session.client(\"ocean_aws\")`\n * `session.client(\"subscription\")`\n\nA full list of endpoints and clients can be found in the documentation [here](./docs/pydocmd/clients/).",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/spotinst/spotinst-sdk-beta-python",
"keywords": "spotinst spot instances aws ec2 cloud infrastructure development elastigroup",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "spotinst-sdk-beta2",
"package_url": "https://pypi.org/project/spotinst-sdk-beta2/",
"platform": "",
"project_url": "https://pypi.org/project/spotinst-sdk-beta2/",
"project_urls": {
"Homepage": "https://github.com/spotinst/spotinst-sdk-beta-python"
},
"release_url": "https://pypi.org/project/spotinst-sdk-beta2/2.1.2/",
"requires_dist": null,
"requires_python": "",
"summary": "A Python SDK for Spotinst",
"version": "2.1.2"
},
"last_serial": 5080754,
"releases": {
"2.0.0": [
{
"comment_text": "",
"digests": {
"md5": "6a7e8a08ad6c8699d5390ad41e572282",
"sha256": "850fb29bac0390f14541b89a28bedbb93aa449ce3d8402f7c69447af624eeb28"
},
"downloads": -1,
"filename": "spotinst-sdk-beta2-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "6a7e8a08ad6c8699d5390ad41e572282",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32995,
"upload_time": "2019-02-25T21:22:23",
"url": "https://files.pythonhosted.org/packages/d3/12/ae51e68c4a383c8639d414ebe8266e1b87c5e19ff15ba3ab54977a97835e/spotinst-sdk-beta2-2.0.0.tar.gz"
}
],
"2.0.1": [
{
"comment_text": "",
"digests": {
"md5": "1dc42ab1e6d0ae3ee646c59255cccba0",
"sha256": "7fd753e458acf2bd80b2df7f600b6f5d1a4ecd17ac60f18d0f38e62d4e9843bb"
},
"downloads": -1,
"filename": "spotinst-sdk-beta2-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "1dc42ab1e6d0ae3ee646c59255cccba0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35450,
"upload_time": "2019-02-25T21:45:58",
"url": "https://files.pythonhosted.org/packages/3e/73/5c4c083b13048ba0533742bcfcc4284b45ecac5a4240c2e19127f6ad3f51/spotinst-sdk-beta2-2.0.1.tar.gz"
}
],
"2.1.1": [
{
"comment_text": "",
"digests": {
"md5": "354873ed5780e1013b1769dc0e003ae4",
"sha256": "2440ca0a65dd17ad01ded673f9fb561199d9c987ceebd370a89e4b9669c98f77"
},
"downloads": -1,
"filename": "spotinst-sdk-beta2-2.1.1.tar.gz",
"has_sig": false,
"md5_digest": "354873ed5780e1013b1769dc0e003ae4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36236,
"upload_time": "2019-03-01T23:07:41",
"url": "https://files.pythonhosted.org/packages/7e/75/82b181df1d8ed07c26e48715fea8ddaa1bd298d6ade2d7cf531e771657e6/spotinst-sdk-beta2-2.1.1.tar.gz"
}
],
"2.1.2": [
{
"comment_text": "",
"digests": {
"md5": "ebb0c6ac0ddbfad00d587c27f6730dca",
"sha256": "567ec6aa1c69cc891c039edc3277f42308e1283a9f53e5a91b2fb3d5929c3706"
},
"downloads": -1,
"filename": "spotinst-sdk-beta2-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ebb0c6ac0ddbfad00d587c27f6730dca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36503,
"upload_time": "2019-04-02T20:39:16",
"url": "https://files.pythonhosted.org/packages/a5/bd/e3ad1118840efe55a426c998e78e14ec5230468002f4d9003966587e8639/spotinst-sdk-beta2-2.1.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "ebb0c6ac0ddbfad00d587c27f6730dca",
"sha256": "567ec6aa1c69cc891c039edc3277f42308e1283a9f53e5a91b2fb3d5929c3706"
},
"downloads": -1,
"filename": "spotinst-sdk-beta2-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ebb0c6ac0ddbfad00d587c27f6730dca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36503,
"upload_time": "2019-04-02T20:39:16",
"url": "https://files.pythonhosted.org/packages/a5/bd/e3ad1118840efe55a426c998e78e14ec5230468002f4d9003966587e8639/spotinst-sdk-beta2-2.1.2.tar.gz"
}
]
}