{
"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-sdk2-beta-python",
"keywords": "spotinst spot instances aws ec2 cloud infrastructure development elastigroup",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "spotinst-sdk2-beta",
"package_url": "https://pypi.org/project/spotinst-sdk2-beta/",
"platform": "",
"project_url": "https://pypi.org/project/spotinst-sdk2-beta/",
"project_urls": {
"Homepage": "https://github.com/spotinst/spotinst-sdk2-beta-python"
},
"release_url": "https://pypi.org/project/spotinst-sdk2-beta/2.0.0/",
"requires_dist": null,
"requires_python": "",
"summary": "A Python SDK for Spotinst",
"version": "2.0.0"
},
"last_serial": 4866667,
"releases": {
"2.0.0": [
{
"comment_text": "",
"digests": {
"md5": "93ba87555434ecb25bf0e16719a88606",
"sha256": "36400d3087b951d4ba23281068c05de7b2005ebf43f4971c4865ffc9d0e1947b"
},
"downloads": -1,
"filename": "spotinst-sdk2-beta-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "93ba87555434ecb25bf0e16719a88606",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32984,
"upload_time": "2019-02-25T21:00:18",
"url": "https://files.pythonhosted.org/packages/6f/4e/d49fccedbf6720e0e889c7619ebebb2dd16e41393bb130200f20992cebd7/spotinst-sdk2-beta-2.0.0.tar.gz"
}
],
"2.0.0-rc1": [
{
"comment_text": "",
"digests": {
"md5": "7fa6f2b6efa01167245ddc0153a72575",
"sha256": "7e0651081a67d3b55f143a6fa9b48469967aebdd6ee78442956add90f840d61c"
},
"downloads": -1,
"filename": "spotinst-sdk2-beta-2.0.0-rc1.tar.gz",
"has_sig": false,
"md5_digest": "7fa6f2b6efa01167245ddc0153a72575",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33052,
"upload_time": "2019-02-25T19:18:22",
"url": "https://files.pythonhosted.org/packages/fa/94/54435ab73cf4ba7b1f9e0d99a53db58a6950116ea64443e32c5d3de88919/spotinst-sdk2-beta-2.0.0-rc1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "93ba87555434ecb25bf0e16719a88606",
"sha256": "36400d3087b951d4ba23281068c05de7b2005ebf43f4971c4865ffc9d0e1947b"
},
"downloads": -1,
"filename": "spotinst-sdk2-beta-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "93ba87555434ecb25bf0e16719a88606",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32984,
"upload_time": "2019-02-25T21:00:18",
"url": "https://files.pythonhosted.org/packages/6f/4e/d49fccedbf6720e0e889c7619ebebb2dd16e41393bb130200f20992cebd7/spotinst-sdk2-beta-2.0.0.tar.gz"
}
]
}